Overview
HuxBottomSheet is a mobile-first modal component that slides up from the bottom of the screen. It is designed to be thumb-friendly and support drag gestures, making it the standard way to present options, forms, and content on mobile devices.
The package also includes HuxActionSheet, a specialized version of the bottom sheet for presenting a list of actionable items, similar to iOS-style action sheets.
Basic Usage
Standard Bottom Sheet
Action Sheet
HuxBottomSheet
Sizes
Control the height of the bottom sheet using fixed variants:HuxBottomSheetSize.small- Takes ~25-30% of screen heightHuxBottomSheetSize.medium- Takes ~50% of screen height (Default)HuxBottomSheetSize.large- Takes ~85% of screen heightHuxBottomSheetSize.fullscreen- Takes the full screen height
Header Options
You can customize the header with a title, subtitle, and control buttons:title: Main heading textsubtitle: Supporting text below the titleshowDragHandle: Whether to show the top drag indicator (Default: true)showCloseButton: Whether to show a close action in the header (Default: false)
Action Buttons
Bottom sheets can include a row of action buttons at the bottom:HuxActionSheet
showHuxActionSheet is optimized for lists of actions. Each item is represented by a HuxActionSheetItem.
Destructive Actions
Mark actions as destructive to style them with the theme’s destructive color:Disabled Actions
Actions can be disabled if they are currently unavailable:API Reference
showHuxBottomSheet Properties
showHuxActionSheet Properties
Accessibility
- Focus Management: The bottom sheet handles focus trapping and restoration.
- Gestures: Drag handle provides a visual hint for dismissible content.
- Contrast: All text and icons follow theme-aware contrast rules.
- Semantic Roles: Action items use proper list and button semantics.