Flex
Flexbox container with token-driven direction, alignment, justification, wrapping, and gap.
Layout props (direction, justify, align, wrap, gap) accept a single value or a
per-breakpoint responsive object like { base: "column", md: "row" }; set responsiveMode
to "container" to resolve breakpoints against the nearest container instead of the viewport.
Usage
Best practices
Flexexposes full flexbox (direction/justify/align/wrap) and defaults to a row; for a simple gapped column reach forStack, for a wrapping clusterGroup.Every layout prop takes a responsive object like
{ base: "column", md: "row" }; setresponsiveMode="container"to resolve breakpoints against the nearest container.asandrenderare mutually exclusive (renderwins, dev-warned);asdraws from the closed layout vocabulary, soas="button"is a type error (useButton).Use
asto change the element (a tag); userenderonly to swap in a component (e.g. a router Link). Neverrender={<Box as=…/>}- passasdirectly.
Props
Also exports
- interface
FlexProps
Composition
Used by
AlertDialog, AttributeCard, Avatar, Breadcrumb, Card, Carousel, Chart, CheckboxCardGroup, ColorPalette, Combobox, Command, CookieBanner, DataGrid, DataGridColumnFilter, DataGridColumnHeader, DataGridPagination, DataGridTable, DeliveryBanner, Dialog, DocumentList, Drawer, EditorialCard, Empty, Field, FolderTile, InputGroup, InputOTP, Item, MarqueeText, MobileNavigationRoot, MonthYearPicker, PageHeader, PageToolbar, Pagination, ProgressDots, PromptPanel, QuickView, RadioCardGroup, RadioGroup, RequirementItem, SearchInput, SectionHeader, SegmentedControl, SettingsCard, Sheet, Sidebar, Sidepanel, SiteFooter, Slider, StreamingText, SubNavigation, Swatch, SwatchFan, TabNavigation, Tabs, TagSelector, ThinkingLoader, ThinkingTrace, Toaster, VariantSelector, LiveWaveform