ActionSheet
Mobile bottom action menu: a list of items (adjacent entries sharing a group are grouped, disabled entries are grayed, color: 'danger' marks a destructive action), an optional header title, and a cancel button. Visibility is a controlled modelValue (same contract as Dialog); the mask and the overlay stack reuse this repo's overlay system (Escape closes only the topmost layer, scroll locking, focus trapping).
Grouping, disabled semantics, mask-close decisions and class names all come from the pure functions in @lh-ui/share/core/action-sheet; when cancelText is not given the cancel button label is taken from the locale pack.
Basic Usage
items holds the actions (name is required, subname is a secondary line). Clicking an enabled item emits select (the item reference plus the global index) and closes the sheet:
<script setup lang="ts">
import { ref } from 'vue'
import { LhButton, LhActionSheet } from '@lh-ui/vue3'
const visible = ref(false)
const items = [
{ name: 'Take a Photo', subname: 'From the camera' },
{ name: 'Choose from Album' },
]
</script>
<template>
<!-- Basic usage -->
<LhButton @click="visible = true">Open Action Sheet</LhButton>
<LhActionSheet v-model="visible" title="Choose an Action" :items="items" />
</template><script>
import { LhButton, LhActionSheet } from '@lh-ui/vue3'
export default {
components: { LhButton, LhActionSheet },
data() {
return {
visible: false,
items: [
{ name: 'Take a Photo', subname: 'From the camera' },
{ name: 'Choose from Album' },
],
}
},
}
</script>
<template>
<!-- Basic usage -->
<LhButton @click="visible = true">Open Action Sheet</LhButton>
<LhActionSheet v-model="visible" title="Choose an Action" :items="items" />
</template>Groups, Disabled and Danger
Adjacent entries sharing a group are sectioned with a gray divider; disabled grays an item out and blocks clicks; color: 'danger' uses the danger token while any other color is applied inline:
<script setup lang="ts">
import { ref } from 'vue'
import { LhButton, LhActionSheet } from '@lh-ui/vue3'
import type { LhActionSheetItem } from '@lh-ui/vue3'
const visible = ref(false)
const items: LhActionSheetItem[] = [
{ name: 'Set as Wallpaper' },
{ name: 'Edit Markers', group: 'edit' },
{ name: 'Rotate and Crop', group: 'edit' },
{ name: 'Delete', color: 'danger' },
]
function onSelect(item: LhActionSheetItem, index: number) {
console.log(item.name, index)
}
</script>
<template>
<!-- Groups and danger actions -->
<LhButton @click="visible = true">Delete Photo</LhButton>
<LhActionSheet v-model="visible" :items="items" cancel-text="Cancel" @select="onSelect" />
</template><script>
import { LhButton, LhActionSheet } from '@lh-ui/vue3'
export default {
components: { LhButton, LhActionSheet },
data() {
return {
visible: false,
items: [
{ name: 'Set as Wallpaper' },
{ name: 'Edit Markers', group: 'edit' },
{ name: 'Rotate and Crop', group: 'edit' },
{ name: 'Delete', color: 'danger' },
],
}
},
methods: {
onSelect(item, index) {
console.log(item.name, index)
},
},
}
</script>
<template>
<!-- Groups and danger actions -->
<LhButton @click="visible = true">Delete Photo</LhButton>
<LhActionSheet v-model="visible" :items="items" cancel-text="Cancel" @select="onSelect" />
</template>Close Behavior
Clicking the mask (closeOnClickMask, default true) and pressing Escape (when this sheet is the topmost layer) both close the sheet and emit update:modelValue; the cancel button emits cancel (pass an empty string to hide it):
<!-- Do not close on mask click (items / cancel / Escape still work) -->
<LhActionSheet v-model="visible" :items="items" :close-on-click-mask="false" />
<!-- Hide the cancel button -->
<LhActionSheet v-model="visible" :items="items" cancel-text="" />API
ActionSheet Props
| Prop | Description | Type | Default |
|---|---|---|---|
| modelValue | Visibility (controlled) | boolean | false |
| items | Action entries | LhActionSheetItem[] | () => [] |
| title | Header title | string | — |
| cancelText | Cancel button label (empty string hides it; defaults to the locale word for "cancel") | string | — |
| closeOnClickMask | Close on mask click | boolean | true |
| safeAreaInsetBottom | Bottom safe-area padding | boolean | true |
| sx | sx quick-layout props (applied to the panel) | LhSxProps | — |
ActionSheet Items
| Prop | Description | Type | Default |
|---|---|---|---|
| name | Action name | string | — |
| subname | Secondary description (gray second line) | string | — |
| disabled | Disable the entry (grayed, not clickable) | boolean | false |
| color | Text color ('danger' uses the danger token; other values apply inline) | string | — |
| group | Group key (adjacent entries sharing it are grouped; no key joins the default group) | string | — |
ActionSheet Events
| Event | Description | Callback |
|---|---|---|
| update:modelValue | Visibility change | (value: boolean) |
| select | Emitted on click of an enabled item (the sheet then closes) | (item: LhActionSheetItem, index: number) |
| cancel | Emitted on cancel button click (the sheet then closes) | — |
Accessibility
- The panel root carries
role="dialog"andaria-modal="true";aria-labelcomes fromtitleor a fixed fallback - Opening traps focus inside the panel and restores it on close (the same focus trap implementation as Dialog / Drawer)
- Each item is a real
<button>; disabled entries carry thedisabledattribute

