Flex Components
Flex Direction
Row (default)
1
2
3
Row Reverse
1
2
3
Column
1
2
3
Column Reverse
1
2
3
Alignment
Justify Content - Center
1
2
3
Justify Content - Between
1
2
3
Align Items - Center
1
2
3
Align Items - Stretch
1
2
3
Wrapping & Spacing
Flex Wrap
1
2
3
4
5
6
Large Gap (gap=6)
1
2
3
Gap X & Y Different
1
2
3
4
Complex: Center + Padding
A
B
C
Custom Component (as prop)
Flex as Section
Header
Content
Footer
Sortable Flex Component
Reorderable Tags (whole chips draggable, wrapping row)
React
Next.js
Tailwind
daisyUI
Motion
Biome
Bun
<SortableFlex gap={ 2 } wrap="wrap" defaultItems={ tags } renderItem={ tag => ( <SortableFlexItem className="badge badge-lg">{ tag.label }</SortableFlexItem> )}/>Controlled Pills (workflow steps)
Current order :Audit → Code → Test → Commit → Push
1.Audit
2.Code
3.Test
4.Commit
5.Push
<SortableFlex gap={ 2 } items={ steps } onReorder={ next => setSteps( next ) } renderItem={ ( step , index ) => <SortableFlexItem ... /> }/>Vertical Direction (simple stacked items)
1React
2Next.js
3Tailwind
4daisyUI
5Motion
6Biome
7Bun
<SortableFlex direction="col" gap={ 2 } defaultItems={ items } renderItem={ ( item , index ) => <SortableFlexItem>...</SortableFlexItem> }/>// direction="col" : a lightweight vertical sortable, without the List markupInline Drag Handles (chips with a remove button)
JavaScript
TypeScript
CSS
A11y
I18n
<SortableFlex handle items={ skills } onReorder={ next => setSkills( next ) } renderItem={ skill => <SortableFlexItem>...</SortableFlexItem> }/>// handle : chips drag only from the inline handle, the remove button stays clickableAsync Reorder with API Call (optimistic revert on failure)
React
Next.js
Tailwind
daisyUI
Motion
Biome
Bun
<SortableFlex defaultItems={ tags } onReorder={ ( items ) => api.saveOrder( items ) } renderItem={ tag => <SortableFlexItem>...</SortableFlexItem> }/>// onReorder may return a promise : a rejection restores the previous orderProps Reference
| Prop | Type | Description |
|---|---|---|
items / defaultItems | Array | Controlled / uncontrolled items (each needs a stable id) |
onReorder | function | (items, { from, to, item }) => void | Promise — a rejected promise reverts the order (uncontrolled) |
renderItem | function | (item, index) => SortableFlexItem element |
handle | boolean | Show an inline drag handle (default false : whole items draggable) |
getItemId | function | Custom accessor for item identity (defaults to item.id) |
disabled | boolean | Disable dragging for all items |
direction / wrap / gap / ... | Flex props | Every other prop is forwarded to Flex (direction, wrapping, gaps, alignment, ...) |