Installation
npx shadcn@latest add @iconiq/icon-barProps
IconBar
5 props
Horizontal toolbar of compact icon chips. Hover or focus previews labels; clicking selects one item and keeps it expanded.
value
string | nullControlled selected item value. Pair with onValueChange for fully controlled selection.
defaultValue
string | nullOptional initial selected item when uncontrolled. Omit to start with every chip collapsed until the user clicks one.
onValueChange
(value: string | null) => voidCalled when selection changes. Receives null when the active chip is clicked again to deselect.
className
stringOptional class names applied to the outer flex container.
children
React.ReactNodeOne or more IconBarItem elements rendered in a single row with consistent spacing.
IconBarItem
6 props
Individual pill chip with a Lucide icon and animated label reveal on hover, focus, or selection.
icon
LucideIconRequired
Lucide icon component rendered inside the fixed 36px icon well.
label
stringRequired
Short text revealed when the chip expands. Keep labels concise so the width animation stays smooth.
value
stringSelection identity for this chip. Defaults to label when omitted.
onClick
(event: React.MouseEvent<HTMLButtonElement>) => voidOptional click handler fired after selection updates.
disabled
booleanDefault
falseDisables interaction, hover preview, and selection.
className
stringOptional class names merged onto the chip button.
Notes
Only one item stays expanded at a time. Clicking a chip selects it; clicking another moves selection; clicking the active chip again collapses it.
Hover and keyboard focus preview labels on non-selected chips. Give each item a unique value when labels repeat.
In controlled mode, update value from onValueChange (including null on deselect) for the UI to stay in sync.