Skip to Content
✨ Just dropped my UI Library — still cooking up some magic! Stay tuned & maybe… hire me  or sponsor me 😉 
DocumentationActionSheet

ActionSheet

A mobile-first bottom sheet component that presents a list of actions in a modal overlay. Perfect for contextual menus, confirmation dialogs, and action selection interfaces commonly seen in mobile applications.

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

Props

PropTypeDefaultDescription
isOpenboolean-Required: Controls whether the action sheet is visible
onClose() => void-Required: Callback function called when the action sheet closes
setIsOpenReact.Dispatch<React.SetStateAction<boolean>>-Required: Function to set the isOpen state
titlestring"Choose an action"Header title displayed at the top of the action sheet
descriptionstringSample descriptionOptional description text below the title
actionsActionSheetAction[]-Required: Array of action objects with label, onClick, and optional props
variant"default" | "filled" | "bordered""default"Visual style variant for the action sheet
size"sm" | "md" | "lg""md"Size variant affecting text size and padding
showCloseButtonbooleantrueWhether to show the X close button in the header
cancelLabelstring"Cancel"Label for the cancel button at the bottom
triggerButtonLabelstring"Show Actions"Label for the trigger button
triggerButtonPropsOmit<ButtonProps, "children">{}Props to customize the trigger button (e.g., variant, size, className)
position"bottom" | "top" | "left" | "right""bottom"Position from which the action sheet slides in
showScrollbooleantrueWhether to show a scrollbar when content overflows

ActionSheetAction Interface

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

Features

  • Mobile-First Design: Slides up from the bottom with smooth spring animations powered by Framer Motion.
  • Keyboard Accessible: Supports Escape key to close and proper focus management.
  • Flexible Actions: Supports custom icons, destructive variants, and disabled states.
  • Multiple Variants: Choose from default, filled, or bordered styling options for the action sheet.
  • Customizable Trigger: Use triggerButtonProps to style the trigger button (e.g., variant, size, className).
  • Position Control: Slide in from bottom, top, left, or right.
  • Backdrop Dismissal: Click outside the action sheet to close it.
  • Body Scroll Lock: Prevents background scrolling when the action sheet is open.
  • Scrollable Content: Optional scrollbar for overflowing content with showScroll prop.
  • Responsive Sizing: Adapts to different screen sizes with maximum width constraints.
  • Dark Mode Ready: Full support for light and dark themes with semantic Tailwind classes.

This component is ideal for mobile applications, admin panels, or any interface requiring contextual actions without navigating away from the current view. The bottom sheet pattern is intuitive for users familiar with native mobile apps, making it perfect for quick action menus like sharing, editing, or deleting items.

Last updated on