Stack
A layout component for arranging elements vertically or horizontally, based on Flexbox. It supports responsive layouts and global theme configuration via BrConfigProvider.
Component Features
- ↕️ Dual Layout: Supports vertical (default) and horizontal arrangement via
directionprop. - ↔️ Alignment Control: Controls alignment via
alignandjustifyprops. - 📏 Gap Control: Controls spacing between stacked elements via
gapprop. - 📱 Responsive Layout: Supports responsive props (object syntax) for different breakpoints.
- 🎛️ Polymorphic Rendering: Changes the underlying HTML element via
asprop for semantic markup. - 🎨 Style Customization: Supports custom styles for rounded corners, shadows, and padding.
- 🌓 Dark Mode: Based on
BrConfigProviderfor automatic dark mode adaptation.
Basic Usage
Vertical Stack
By default, BrStack arranges elements vertically (flex-col).
Horizontal Stack & Alignment
Use direction="horizontal" for horizontal arrangement, and control alignment with align and justify.
Responsive & Custom Styles
BrStack supports responsive properties (object syntax) and style customization (radius, shadow, padding).
Polymorphic Rendering
Use the as prop to change the underlying HTML element of the Stack, such as ul, li, or section for semantic markup.
Theming
Global base styles for Stack (like border radius) can be controlled via BrConfigProvider.