Components
- Accordion new
- ActionSheet new
- Alert new
- Alert Dialog new
- Angle Slider new
- Autocomplete new
- Avatar new
- Badge new
- Breadcrumb new
- Button new
- Button Group new
- Card new
- Carousel new
- Checkbox new
- Clipboard new
- Collapsible new
- Color Picker new
- Date Input new
- Date Picker new
- Dialog new
- DialogCaller new
- Drawer beta
- Editable new
- Empty new
- Field new
- Fieldset new
- File Upload new
- Filters new
- Floating Panel new
- Hover Card new
- Image new
- Image Cropper new
- Input new
- Input Group new
- Json Tree View new
- Kbd new
- Listbox new
- Marquee new
- Menu new
- Number Input new
- Pagination new
- Password Input new
- PhoneField new
- Pin Input new
- Popover new
- Progress Circular new
- Progress Linear new
- Qr Code new
- Radio Group new
- Rating Group new
- Scroll Area new
- ScrollSpy new
- Segment Group new
- Select new
- Separator new
- Sidebar new
- Signature Pad new
- Skeleton new
- Slider new
- Splitter new
- Steps new
- Switch new
- Table new
- Tabs new
- Tags Input new
- Textarea new
- Timeline new
- Timer new
- Toast new
- Toc new
- Toggle new
- Toggle Group new
- Tooltip new
- Tour new
- Tree View new
- Typography new
Features
- Zag state machine — Open/close, dismiss, option selection, and cancel are modeled with a custom
@zag-jsmachine (not Ark Dialog) - Programmatic API — Define the action sheet with
useActionSheet(), pass it toActionSheet.Provider, thenawait show()for a typed result (ActionSheetStartResult) when the user picks an option, cancels, or dismisses the sheet - Classic usage — Control visibility with
v-model:openand open viaActionSheet.Trigger - Composable layout — Stack multiple
ActionSheet.Groupblocks for separated groups of actions
Installation
Install from the Vuzeno registry:
bunx --bun shadcn-vue@latest add https://vuzeno.com/r/action-sheet.json
npx shadcn-vue@latest add https://vuzeno.com/r/action-sheet.json
yarn dlx shadcn-vue@latest add https://vuzeno.com/r/action-sheet.json
pnpm dlx shadcn-vue@latest add https://vuzeno.com/r/action-sheet.json
Usage
<script setup lang="ts">
import { ActionSheet } from "@/components/ui/action-sheet";
import { Button } from "@/components/ui/button";
import { ref } from "vue";
const isOpen = ref(false);
</script>
<template>
<ActionSheet.Root v-model:open="isOpen">
<ActionSheet.Trigger as-child>
<Button>Open Action Sheet</Button>
</ActionSheet.Trigger>
<ActionSheet.Content>
<ActionSheet.Group>
<ActionSheet.Option value="option1">Option 1</ActionSheet.Option>
<ActionSheet.Option value="option2">Option 2</ActionSheet.Option>
</ActionSheet.Group>
<ActionSheet.Cancel>Cancel</ActionSheet.Cancel>
</ActionSheet.Content>
</ActionSheet.Root>
</template>
Composition
ActionSheet.Root
├── ActionSheet.Trigger
└── ActionSheet.Content
├── ActionSheet.Group
│ └── ActionSheet.Option
└── ActionSheet.Cancel
ActionSheet.Provider
└── ActionSheet.Content
├── ActionSheet.Group
│ └── ActionSheet.Option
└── ActionSheet.Cancel
Examples
Classic action sheet
Use ActionSheet.Trigger to open the sheet and ActionSheet.Option for each choice. ActionSheet.Cancel fires the cancel path (and closes the sheet).
Provider API
Define the action sheet with useActionSheet(), then pass it to ActionSheet.Provider to drive it programmatically. Call show() and await the result — the promise resolves when the user selects an option, taps cancel, or closes the overlay (when closeOnClickOutside is enabled).
<script setup lang="ts">
import { ActionSheet, useActionSheet } from "@/components/ui/action-sheet";
import { Button } from "@/components/ui/button";
const actionSheet = useActionSheet({
showOverlay: true,
closeOnClickOutside: true,
});
async function openActionSheet() {
const result = await actionSheet.value.show();
if (result.cancelled) {
// result.cancelledReason is "cancel" | "close"
} else {
// result.selectedOption is the chosen value
}
}
</script>
<template>
<div class="flex flex-col gap-4">
<Button @click="openActionSheet()">Open Action Sheet</Button>
<ActionSheet.Provider :value="actionSheet">
<ActionSheet.Content>
<ActionSheet.Group>
<ActionSheet.Option value="option1">Option 1</ActionSheet.Option>
<ActionSheet.Option value="option2">Option 2</ActionSheet.Option>
</ActionSheet.Group>
<ActionSheet.Cancel>Cancel</ActionSheet.Cancel>
</ActionSheet.Content>
</ActionSheet.Provider>
</div>
</template>
Multiple option groups
Compose several ActionSheet.Group components inside ActionSheet.Content to separate primary actions from secondary ones.
<template>
<ActionSheet.Root v-model:open="isOpen">
<ActionSheet.Trigger as-child>
<Button>Open</Button>
</ActionSheet.Trigger>
<ActionSheet.Content>
<ActionSheet.Group>
<ActionSheet.Option value="edit">Edit</ActionSheet.Option>
<ActionSheet.Option value="duplicate">Duplicate</ActionSheet.Option>
</ActionSheet.Group>
<ActionSheet.Group>
<ActionSheet.Option value="archive">Archive</ActionSheet.Option>
<ActionSheet.Option value="delete">Delete</ActionSheet.Option>
</ActionSheet.Group>
<ActionSheet.Cancel>Cancel</ActionSheet.Cancel>
</ActionSheet.Content>
</ActionSheet.Root>
</template>
API Reference
ActionSheet.Root
| Prop | Type | Default |
|---|---|---|
open | boolean | false |
closeOnClickOutside | boolean | true |
showOverlay | boolean | true |
closeOnEscape | boolean | true |
ActionSheet.Provider
| Prop | Type | Default |
|---|---|---|
value | ActionSheetApi | — |
Takes the object returned by useActionSheet() and drives the sheet's open state and callbacks from it.
useActionSheet
function useActionSheet(props?: {
showOverlay?: boolean;
closeOnClickOutside?: boolean;
closeOnEscape?: boolean;
open?: boolean;
defaultOpen?: boolean;
onOpenChange?: (details: { open: boolean }) => void;
onSelectOption?: (details: { value: unknown }) => void;
onCancel?: () => void;
onDismiss?: () => void;
}): ComputedRef<ActionSheetApi>;
Returns a computed ActionSheetApi with:
| Member | Type | Description |
|---|---|---|
show() | () => Promise<ActionSheetStartResult> | Opens the sheet and resolves when the user selects an option, cancels, or dismisses it |
close() | () => void | Closes the sheet |
setOpen(open) | (open: boolean) => void | Opens or closes the sheet |
open | boolean | Current open state |
ActionSheetStartResult
type ActionSheetStartResult<O> =
| { cancelled: false; cancelledReason: null; selectedOption: O }
| { cancelled: true; cancelledReason: "cancel" | "close"; selectedOption: null }