npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-action-sheet.json --yesAction sheet
ProA list of actions on one thing, for React and Tailwind CSS. Part of Goop Pro.
What an agent sees
- ActionSheetTriggerThe control that opens the actions
- ActionSheetContentThe actions' layer
- ActionSheetActionOne action
- ActionSheetCancelCloses the sheet with no action, in a row of its own under the actions ("Cancel" when it holds no words)
import { ActionSheet, ActionSheetTrigger, ActionSheetContent, ActionSheetAction, ActionSheetCancel } from '@/components/ui/goop/action-sheet';
import { useState } from 'react';
import { IconButton, IconButtonIcon } from '@/components/ui/goop/icon-button';
function ReportActions() {
const [archived, setArchived] = useState(false);
return (
<ActionSheet>
<ActionSheetTrigger asChild>
<IconButton variant="ghost" aria-label="Actions for Q3 report">
<IconButtonIcon icon="dots" />
</IconButton>
</ActionSheetTrigger>
<ActionSheetContent title="Q3 report" description={archived ? 'In the archive.' : 'Shared with the team.'}>
<ActionSheetAction icon="copy">Duplicate</ActionSheetAction>
<ActionSheetAction icon="archive" disabled={archived} onSelect={() => setArchived(true)}>
Move to archive
</ActionSheetAction>
<ActionSheetAction icon="trash" destructive>
Delete report
</ActionSheetAction>
<ActionSheetCancel />
</ActionSheetContent>
</ActionSheet>
);
}Pick Phone or Wider window, then press Note actions (or Tab onto it and press Enter or Space): on the phone the actions rise as a sheet from the screen’s foot with Cancel under them, wider they open as a menu under the button. Star, Duplicate, Move to archive or the red Delete note changes the list, and the line under it says what ran; Cancel, Escape or a press outside run nothing, and the line says so. The notes are our own and live in this page alone: nothing is starred, copied, archived or deleted anywhere.
When to use
- A list of actions on one thing.
Installation
Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Action sheet on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-action-sheet.json --yesAdd the Goop Action sheet to this project. The install steps are at https://goop.so/docs/install.mdUsage
import { ActionSheet, ActionSheetTrigger, ActionSheetContent, ActionSheetAction, ActionSheetCancel } from '@/components/ui/goop/action-sheet';
import { useState } from 'react';
import { IconButton, IconButtonIcon } from '@/components/ui/goop/icon-button';
function ReportActions() {
const [archived, setArchived] = useState(false);
return (
<ActionSheet>
<ActionSheetTrigger asChild>
<IconButton variant="ghost" aria-label="Actions for Q3 report">
<IconButtonIcon icon="dots" />
</IconButton>
</ActionSheetTrigger>
<ActionSheetContent title="Q3 report" description={archived ? 'In the archive.' : 'Shared with the team.'}>
<ActionSheetAction icon="copy">Duplicate</ActionSheetAction>
<ActionSheetAction icon="archive" disabled={archived} onSelect={() => setArchived(true)}>
Move to archive
</ActionSheetAction>
<ActionSheetAction icon="trash" destructive>
Delete report
</ActionSheetAction>
<ActionSheetCancel />
</ActionSheetContent>
</ActionSheet>
);
}- Fits: list, record: overlay.
- Also known as: ActionMenu, BottomSheetMenu.
- height, width, padding, gap, corner, border, background, text: add no class for these.
API reference
| Option | Type | What it does |
|---|---|---|
| open? | boolean | Whether it is open, when the caller holds it (with onOpenChange). |
| defaultOpen? | boolean = false | Whether it is open at first, when the root holds it. |
| onOpenChange? | (open: boolean) => void | Hears every open and close: the trigger, an action, Cancel, Escape, a press outside. |
| presentation? | 'auto' | 'sheet' | 'menu' = 'auto' | auto (the default): the bottom sheet under the theme's narrow breakpoint, the menu above it. |
| children? | ReactNode | The trigger and the content. |
- State: open (open / defaultOpen / onOpenChange)
| Part | What it is |
|---|---|
| ActionSheetTrigger | The control that opens the actions; takes asChild |
| ActionSheetContent | The actions' layer; title?: ReactNode — The words over the actions: the sheet's title (its spoken name) or the menu's label; description?: ReactNode — A sentence under the title: the sheet's description, or a grey line under the menu's label; label?: string = 'Actions' — The spoken name when no title is drawn ("Actions" when left out); container?: HTMLElement | null — Where the layer is portalled; the end of <body> when left out; className?: string — Your classes, on the sheet's panel or the menu's panel; children?: ReactNode — The ActionSheetActions, then an ActionSheetCancel |
| ActionSheetAction | One action; children?: ReactNode — The action's words; onSelect?: (event: Event) => void — Runs the action, on a press, Enter or Space; the layer then closes, unless the handler calls event.preventDefault(); destructive?: boolean = false — The action that deletes or cannot be undone: its words and icon in the theme's red, its wash red; disabled?: boolean = false — Takes the action out of the keys and the pointer; it fades; icon?: IconName — A pack icon's name, drawn before the words in a 16 px box; className?: string — Your classes, on the row |
| ActionSheetCancel | Closes the sheet with no action, in a row of its own under the actions ("Cancel" when it holds no words); children?: ReactNode = 'Cancel'; className?: string |
Keyboard
| Key | What it does |
|---|---|
| Enter Space | On the trigger, open; on an action, run it and close |
| ArrowDown | The next action (Cancel last, then round to the first) |
| ArrowUp | The action before, round from the first to Cancel |
| Home End | The first action or Cancel |
| Escape | Close, the focus back on the trigger |
| Tab | Move to the next control, held inside the sheet |
Accessibility
- The native element answers the keyboard.
- hover, active, focus-visible: the browser's own (:hover, :active, :focus-visible): write nothing
Notes for AI
Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.