---
title: Chip Input
description: Accessible, keyboard-navigable multi-chip tag editor and badge selector for forms.
---
Chip Input
Accessible multi-chip tag editor, autocomplete badge selector, and token input control with keyboard navigation, custom separators, and duplicate rejection.
Interactive Chip Editor
Type text and press Enter or , to create tags. Press Backspace to delete.
HTML & JavaScript Usage
<div id="myTags" class="boodoo-chip-input-container" data-placeholder="Add skills..."></div>
<script>
import { ChipInput } from 'boodoo';
const chips = new ChipInput('#myTags', {
initialChips: ['JavaScript', 'TypeScript', 'CSS'],
maxChips: 10,
allowDuplicates: false,
onChange: (chips) => console.log('Current tags:', chips)
});
</script>
API Reference & Options
| Option | Type | Default | Description |
|---|---|---|---|
initialChips |
string[] |
[] |
Array of initial string chip tags to populate into the input. |
maxChips |
number |
Infinity |
Maximum number of chips allowable in the container. |
allowDuplicates |
boolean |
false |
Whether identical tag strings can be added multiple times. |
separators |
string[] |
[',', 'Enter'] |
Key triggers that confirm and convert text into a chip token. |