Chips
A component for displaying and managing a collection of small items or tags that users can add and remove.
Basic Usage
Basic Chips
Simple chips with add and remove functionality
- React
- TypeScript
Fruit Tags
Chips with custom placeholder and preset values
- Apple
- Banana
- Cherry
import { Chips } from 'fluxo-ui';
function MyComponent() {
const [chips, setChips] = useState(['React', 'TypeScript']);
return (
<Chips
value={chips}
placeholder="Add tags..."
onChange={(e) => setChips(e.value)}
/>
);
}Limited Chips
Limited Chips
Maximum 3 chips allowed
Non-removable Chips
Chips that cannot be removed
- Fixed
- Tags
- Here
import { Chips } from 'fluxo-ui';
function MyComponent() {
const [chips, setChips] = useState([]);
return (
<Chips
value={chips}
placeholder="Max 5 tags, comma separated..."
maxItems={5}
separator=","
allowDuplicates={false}
onChange={(e) => setChips(e.value)}
/>
);
}States
Disabled State
Chips in disabled state
- Disabled
- Chips
Import
import { Chips } from 'fluxo-ui';Props
valuestring[]"[]"Array of chip values
valuestring[]"[]"Array of chip values
onChangefunctionCallback fired when chips change: (event: ComponentEvent<string[]>) => void
onChangefunctionCallback fired when chips change: (event: ComponentEvent<string[]>) => void
placeholderstring""Type and press Enter to add""Placeholder text for input
placeholderstring""Type and press Enter to add""Placeholder text for input
maxItemsnumberMaximum number of chips allowed
maxItemsnumberMaximum number of chips allowed
allowDuplicatesbooleanfalseWhether duplicate chips are allowed
allowDuplicatesbooleanfalseWhether duplicate chips are allowed
separatorstring"",""Separator character for adding multiple chips at once
separatorstring"",""Separator character for adding multiple chips at once
disabledbooleanfalseWhether the component is disabled
disabledbooleanfalseWhether the component is disabled
readonlybooleanfalseWhether the component is readonly (no input or removal allowed)
readonlybooleanfalseWhether the component is readonly (no input or removal allowed)
idstringHTML id attribute for the container
idstringHTML id attribute for the container
namestringHTML name attribute for the hidden input
namestringHTML name attribute for the hidden input
argsanyCustom arguments passed to onChange callback
argsanyCustom arguments passed to onChange callback
ariaLabelstringAccessible label for the chip list and input
ariaLabelstringAccessible label for the chip list and input
commitOnTabbooleantrueCommit the current input as a chip when Tab is pressed (common tag-input UX)
commitOnTabbooleantrueCommit the current input as a chip when Tab is pressed (common tag-input UX)
Features
Add & Remove
Type and press Enter or comma to add chips; click x to remove any chip
Max Items
Optionally cap the number of chips with the maxItems prop
Duplicate Control
Allow or prevent duplicate entries via the allowDuplicates prop
Custom Separator
Define which character splits a pasted or typed string into multiple chips
Disabled & Readonly
Fully supports disabled (no interaction) and readonly (display-only) modes
Accessibility
Keyboard navigation, ARIA roles and labels for screen reader support
Theming
Full dark/light + 5 brand themes via CSS variables -- zero extra config