Chip Input

Semantic chip input component for managing multiple values like tags, keywords, or email recipients. Supports removal, suggestions, and keyboard interaction.

Tag Input with Suggestions

React TypeScript
  • JavaScript
  • CSS
  • Web Development
  • Frontend
  • UI Design
<div class="chips" role="region" aria-label="Tag input">
				<!-- Existing chip -->
				<span class="chip">
				React
				<button class="remove" aria-label="Remove React">&times;</button>
				</span>

				<!-- Input field -->
				<input type="text" placeholder="Add more tags..." aria-label="Add new tag">
				</div>

				<!-- Suggestions -->
				<ul class="suggestions">
				<li class="">JavaScript</li>
				<li class="">CSS</li>
				</ul>

Email Recipients

alice@example.com bob@example.com carol@example.com
<div class="chips" role="region" aria-label="Email recipients">
				<span class="chip">
				alice@example.com
				<button class="remove" aria-label="Remove alice@example.com">&times;</button>
				</span>
				<input type="email" placeholder="Add email..." aria-label="Add email recipient">
				</div>

Structure

  • `.chips` - Flex wrapper for chips and input
  • `.chip` - Individual chip with remove button
  • `.remove` - Unstyled button for deletion
  • `` - Native text input for new entries
  • `.suggestions` - Unordered list of suggestions
  • `li` - Clickable suggestion item
  • `role="region"` - ARIA landmark for chip area

Key Features

  • Semantic HTML - Native ``, `

Use Cases

  • Tags/Keywords - Article tagging and filtering
  • Email Recipients - To, CC, BCC fields
  • Skills/Interests - User profile setup
  • Team Members - Multi-user selection
  • Permissions - Grant access to multiple users
  • Filtering - Multi-select filter tags

Accessibility

  • Use semantic HTML elements: ``, `

Responsive Behavior

Input fields adapt for optimal usability:

Mobile (< 768px)

  • Full-width within container
  • Minimum height 44px (touch target)
  • Large text size (16px+) prevents zoom
  • Appropriate touch keyboard displays
  • Error messages clearly visible

Desktop (1024px+)

  • Width based on input type/length
  • Hover and focus states visible
  • Inline labels possible
  • Autocomplete suggestions clear

Framework Integration

  • Responsive sizing automatic
  • Labels stack on mobile
  • Error states responsive
  • Accessibility maintained

Best Practices

  • Always provide remove buttons (× or trash icon)
  • Validate input before adding (no duplicates)
  • Show relevant suggestions for quick entry
  • Make chips visually distinct from input area
  • Support full keyboard accessibility
  • Display count of chips added
  • Clear input field after chip is added
  • Handle backspace to delete last chip

Features

  • Semantic Structure - Built with native HTML5 elements for maximum reliability.
  • Theme Aware - Automatically adapts to all 22 Axiom01 themes via OKLCH tokens.
  • Fully Responsive - Scales perfectly from mobile to desktop screens.
  • No JS Dependency - Core functionality relies on pure CSS for maximum performance.
  • Customizable - Easily extendable via Axiom01's design tokens and modifiers.