Skip to Content
✨ QuickCode UI keeps growing! More components, more features, and more ways to make your projects shine. Stay tuned & maybe… hire me or sponsor me 😉 
DocumentationActionSheet

ActionSheet

A flexible modal overlay component that slides in from any direction to present contextual actions or content. Built with compound pattern for maximum composition flexibility.

Install Dependencies

npx
quickcode-ui add ActionSheet

Open from Bottom

Open from Bottom

Open from Top

Open from Top

Open from Left

Open from Left

Open from Right

Open from Right

ActionSheet Props

PropTypeDefaultDescription
childrenReact.ReactNode-ActionSheet sub-components
isOpenboolean-Controls visibility of the action sheet
onClose() => void-Callback when action sheet closes
position"bottom" | "top" | "left" | "right""bottom"Position to slide in from
variant"default" | "filled" | "bordered""default"Visual style variant
size"sm" | "md" | "lg""md"Size affecting text and padding
classNamestring-Additional CSS classes

ActionSheet.Trigger Props

PropTypeDefaultDescription
childrenReact.ReactNode-Trigger button content
asChildbooleanfalseCompose with child element instead of Button
classNamestring-Additional CSS classes

ActionSheet.Header Props

PropTypeDefaultDescription
childrenReact.ReactNode-Header content (Title, Description)
showCloseButtonbooleantrueShow X close button
classNamestring-Additional CSS classes

ActionSheet.Title Props

PropTypeDefaultDescription
childrenReact.ReactNode-Title text
classNamestring-Additional CSS classes

ActionSheet.Description Props

PropTypeDefaultDescription
childrenReact.ReactNode-Description text
classNamestring-Additional CSS classes

ActionSheet.Content Props

PropTypeDefaultDescription
childrenReact.ReactNode-Content (Actions or custom content)
showScrollbooleantrueShow scrollbar when content overflows
classNamestring-Additional CSS classes

ActionSheet.Actions Props

PropTypeDefaultDescription
actionsActionSheetAction[]-Array of action objects
classNamestring-Additional CSS classes

ActionSheet.Footer Props

PropTypeDefaultDescription
childrenReact.ReactNode-Custom footer content
cancelLabelstring"Cancel"Cancel button label
classNamestring-Additional CSS classes

ActionSheetAction Interface

PropertyTypeRequiredDescription
labelstringText displayed for the action
onClick() => voidFunction called when action is selected
variant"default" | "destructive"Visual style, destructive shows in red
disabledbooleanWhether the action is disabled
iconReact.ReactNodeOptional icon displayed before the label

Custom Content & Mixed Actions

Mix ActionSheet.Actions with custom JSX, or use completely custom content:

// Mixed: Actions + Custom <ActionSheet.Content> <ActionSheet.Actions actions={actions} /> <div className="mt-4 pt-4 border-t border-border"> <button className="w-full p-3 border border-border rounded hover:bg-muted"> Custom Button </button> </div> </ActionSheet.Content> // Fully Custom Content <ActionSheet.Content> <div className="space-y-4"> <div className="border-2 border-dashed border-border rounded-lg p-8 text-center"> <Upload className="w-8 h-8 mx-auto mb-2 text-muted-foreground" /> <p className="text-sm text-muted-foreground">Drag files here</p> </div> <div className="flex gap-2"> <button className="flex-1 p-2 border border-border rounded">Camera</button> <button className="flex-1 p-2 border border-border rounded">Gallery</button> </div> </div> </ActionSheet.Content> // Custom Footer for Left/Right positions <ActionSheet.Footer> <button className="w-full p-2 text-sm border border-border rounded"> Custom Footer Action </button> </ActionSheet.Footer>
Last updated on