Components

Action Sheet

Source
Present a mobile bottom sheet containing grouped actions.
Install with the CLI
npx @vyui/cli add action-sheet

Overview

VyActionSheet presents actions in a bottom-anchored sheet. It supports drag-to-dismiss, an optional backdrop and handle, grouped items, semantic row colors, avatars, custom item slots, and controlled or uncontrolled open state.

Built on the headless Sheet primitive from @vyui/core. Drop down to it when you need full control over the snap behavior and markup.

Usage

The default slot is wrapped in the core SheetTrigger; tapping it opens the sheet. Do not also set the open state from a tap handler on the slotted child.

Grouped actions

Pass nested arrays to insert separators between groups.

Custom rows

The item slots receive the flattened item index. Leading and trailing slots also receive the resolved icon color.

<VyActionSheet :items="items">
  <VyButton>Choose a person</VyButton>

  <template #item-label="{ item }">
    <view class="flex-1">
      <text class="font-medium">{{ item.label }}</text>
      <text class="text-sm text-neutral-500">{{ item.email }}</text>
    </view>
  </template>

  <template #item-trailing="{ iconColor }">
    <VyIcon name="i-lucide-chevron-right" :color="iconColor" />
  </template>
</VyActionSheet>

Features and behavior

  • Bind v-model:open to open, or use the v-model alias backed by modelValue.
  • Both update:open and update:modelValue are emitted on every open-state change.
  • Flat items render as one list. Nested arrays render as groups separated by themed dividers.
  • Selecting an enabled row calls its onSelect, emits select, then closes by default.
  • Disabled rows are dimmed and do not call handlers or emit select.
  • dismissible controls both backdrop dismissal and drag-to-close.
  • cancel can be true for the label Cancel, a custom string, or false to hide the row.

Action sheet item

FieldTypeDefaultDescription
labelstringRow label.
iconstringLeading Iconify icon name.
avatarAvatarPropsLeading VyAvatar; takes the built-in position instead of icon.
trailingIconstringTrailing Iconify icon name.
colorColorNeutral stylingSemantic row color.
disabledbooleanfalsePrevents selection.
valueanyOptional application value available on the emitted item.
onSelect(item: ActionSheetItem) => voidCalled before auto-close and the sheet-level select event completes.
[key: string]anyAdditional application data forwarded in slot props.

Props

PropTypeDefaultDescription
openbooleanundefinedControlled open state used by v-model:open; takes precedence over modelValue.
modelValuebooleanundefinedConvenience controlled state used by v-model.
defaultOpenbooleanfalseInitial state when uncontrolled.
itemsActionSheetItem[] | ActionSheetItem[][]undefinedFlat or grouped actions.
titlestringundefinedUppercase section heading.
descriptionstringundefinedSupporting text below the title.
overlaybooleantrueRenders the dimmed backdrop.
dismissiblebooleantrueEnables backdrop and drag dismissal.
closeOnSelectbooleantrueCloses after an enabled item is selected.
handlebooleantrueShows the drag handle.
cancelboolean | stringfalseShows the cancel row and optionally customizes its label.
size'sm' | 'md' | 'lg''md'Row, label, and icon scale.
classanyundefinedClasses merged onto the sheet content.
uiPartial<Record<ActionSheetSlot, any>>undefinedPer-instance theme slot overrides.

Color defaults to primary, secondary, success, info, warning, error, or neutral, and can be extended through the kit color registry.

Emits

EventPayloadDescription
update:openbooleanOpen-state update for v-model:open.
update:modelValuebooleanOpen-state update for v-model.
selectActionSheetItemAn enabled item was selected.
cancelnoneThe cancel row was tapped, before the sheet closes.

Slots

SlotPropsDescription
default{ open: boolean }Trigger content.
headerReplaces the title and description block.
item-leading{ item, index, iconColor }Replaces an item's icon or avatar.
item-label{ item, index }Replaces an item's label.
item-trailing{ item, index, iconColor }Replaces an item's trailing icon.

Styling and theming

Override globally through appConfig.ui.actionSheet or locally with ui.

UI slotPurpose
overlayFull-screen backdrop.
contentBottom sheet panel and maximum height.
handleDrag indicator.
headerHeading and description wrapper.
titleHeader title.
descriptionHeader supporting text.
listScrollable action list.
itemInteractive action row.
itemLeadingIconBuilt-in leading icon.
itemLeadingAvatarBuilt-in avatar wrapper.
itemLabelBuilt-in label text.
itemTrailingIconBuilt-in trailing icon.
separatorDivider between item groups.
cancelCancel row container.
cancelLabelCancel row text.

Variants are size, per-item color, and per-item disabled. Semantic colors tint the label, leading icon, and pressed background.

Accessibility

The trigger exposes native button semantics and announces collapsed or expanded state. Give icon-only trigger content an accessibility-label. Ensure custom item slots retain a clear visible label, and avoid relying on color alone to identify destructive actions.

The current action rows and cancel row are tappable Lynx view elements without an explicit native button role. Treat this as a current accessibility limitation when choosing the component for critical actions and test the resulting experience with VoiceOver and TalkBack.

Platform notes

  • The sheet uses @vyui/core native Sheet primitives for presence, bottom anchoring, drag, snap, fling, and backdrop synchronization.
  • Lynx SVG does not inherit currentColor, so built-in and custom icon slots receive resolved hex colors.
  • The content list is vertically scrollable and capped at the dynamic viewport height.
  • Alert for persistent status messaging.
  • DropdownMenu for an anchored action menu.
  • Modal or Drawer for richer interactive content.