Overlays

Sheet

A modal panel anchored to an edge of the screen, for forms and filters that need more room than a popover but shouldn’t take over the centre of the page.

Installation #

With the Nuxt module, every component is auto-imported — there is nothing to add. In a plain Vue project, import what you use:

Copy
import { JSheet } from '@juxtui/ui'

Usage #

Copy
<JButton @click="open = true">Edit profile</JButton>

<JSheet v-model:open="open" title="Edit profile" description="Changes are visible to your team.">
  <JInput v-model="name" label="Name" />
  <template #footer="{ close }">
    <JButton variant="ghost" @click="close">Cancel</JButton>
    <JButton @click="save">Save</JButton>
  </template>
</JSheet>

Sheet shares Dialog’s focus trap, scroll lock and backdrop handling — it just slides in from an edge instead of appearing centred.

Variants & examples #

Sides#

side controls which edge it slides in from: left, right or bottom.

Required decision#

With close-on-overlay and close-on-escape off, dismissal attempts get a small nudge instead.

API #

Props

PropTypeDefault Description
openbooleanfalseBound with v-model:open.
titlestring—Heading. Labels the sheet.
descriptionstring—Supporting text. Describes the sheet.
side'right' | 'left' | 'bottom''right'Edge the sheet slides in from.
size'sm' | 'md' | 'lg''md'Width (or height for bottom): 320, 400 or 560px.
closeOnOverlaybooleantrueClose when the backdrop is clicked.
closeOnEscapebooleantrueClose when Escape is pressed.
hideClosebooleanfalseHide the close button in the corner.
ariaLabelstring—Accessible name when there is no visible title.

Events

EventPayload Description
update:openbooleanEmitted when the sheet asks to close.
afterClose—After the leave transition — a good moment to reset form state.

Slots

SlotProps Description
default{ close }Body content.
footer{ close }Actions, right-aligned.
header{ titleId, descriptionId }Replace the header. Put titleId on your heading to keep the sheet labelled.

Methods

MethodSignature Description
close()() => voidClose the sheet programmatically.

Accessibility #

  • role="dialog" with aria-modal, labelled by the title and described by the description.
  • On open, focus moves to an element marked autofocus, else the first form field, else the sheet itself.
  • On close, focus returns to whatever opened it.
  • A click only dismisses when it both starts and ends on the backdrop — dragging a text selection out of the sheet never closes it.
  • Under reduced motion, the sheet fades in place instead of sliding from its edge.

Keyboard #

Key Action
TabMoves focus to the next element inside the sheet, wrapping at the end.
ShiftTabMoves focus backwards, wrapping at the start.
EscCloses the sheet (unless `close-on-escape` is off, in which case it nudges instead).