Products · Components

Sheet

A panel that slides up from the bottom, over the page.

The sheet doesn't close on its own: set open back to false in onClose.

Children: Components

Example

The Sheet component
view.dml
<View>
  <Button variant="secondary" onClick="openSheet">Payment options</Button>
  <Sheet open="{{ open }}" title="Payment" onClose="close">
    <Button variant="secondary" onClick="close">Copy reference</Button>
    <Button onClick="close">Done</Button>
  </Sheet>
</View>
controller.ts
export default definePage({
  initialState: { open: false },
  mutations: {
    openSheet: () => ({ open: true }),
    close: () => ({ open: false }),
  },
});

Props

PropTypeWhat it is
openbooleanWhether the sheet shows.
titlestring
showCloseIconbooleanShows a close button in the corner. Tapping it sends onClose, as tapping outside does.
padding, paddingTop, paddingStart, paddingEnd, paddingBottomspacingSpace inside its edges, all round or on one side.

Events

EventSendsNotes
onCloseNothingThe person tapped outside it or its close button.

Keep reading

On this page