Products · Components

Pinned

Keeps what it holds on the top or bottom edge of the screen while the page scrolls.

Put it in the page's root View: first for edge="top", last for edge="bottom". Its bar reaches both sides of the screen, past the View's padding. At the bottom, use a Pinned or a Footer, not both.

Children: Components

Example

The Pinned component
view.dml
<Pinned edge="bottom" border="subtle">
  <Tabs variant="bar" value="{{ tab }}" onChange="setTab">
    <Tab value="home" label="Home" icon="home" />
    <Tab value="orders" label="Orders" icon="receipt" badge="2" />
    <Tab value="account" label="Account" icon="user" />
  </Tabs>
</Pinned>
controller.ts
export default definePage({
  initialState: { tab: 'home' },
  mutations: {
    setTab: (_state, event: ValueEvent) => ({ tab: event.detail.value }),
  },
});

Props

PropTypeWhat it is
edgetop, bottomThe edge of the screen it stays on. Default: top.
gapspacingSpace between its children. Default: medium.
backgroundbackground, or a custom colorWhat fills the bar. Default: background.
borderborderA line along the side that faces the page. Default: none.
padding, paddingTop, paddingStart, paddingEnd, paddingBottomspacingSpace inside its edges, all round or on one side.

Events

None.

Keep reading

On this page