Chip
Chips are compact elements that represent an input, attribute, or action. They are commonly used for tags, filters, and selections.
Overview
Chips are small, interactive elements that represent discrete pieces of information or actions. They provide a compact way to display tags, filters, selections, and other categorical information.
All chip styles are built using design tokens, ensuring consistency across themes and hues. Use the interactive playground below to explore all available combinations.
Interactive Playground
Use the controls to customize the chip and see how it looks in real-time. Toggle between themes and hues to see how chips adapt to different contexts.
<Chip />Anatomy
A chip consists of a rounded container with optional icon and text label. The container uses tonal background colors and can optionally display borders.
Rounded pill shape, border-radius: fullOptional ListDetailsIcon (16px/20px/24px based on size)Text contentVariants & States
Chips come in different colors, sizes, and configurations to fit various use cases.
Primary
Default color variant using primary tonal background and primary-on-tonal foreground.
Neutral
Neutral variant using page-tertiary background and neutral-tertiary foreground.
Success
Success variant for positive states and confirmations.
Critical
Critical variant for errors and important warnings.
Warning
Warning variant for cautionary states.
With Borders
Chips can display borders for added visual definition.
With Icon
Chips can include an optional icon before the label text.
Small
Compact size (16px icon) for dense interfaces or when space is limited.
Medium
Default size (20px icon) suitable for most use cases.
Large
Larger size (24px icon) for improved visibility and accessibility.
Usage Guidelines
- Use chips to represent tags, filters, or selections.
- Use chips for compact categorical information.
- Choose appropriate color variants based on semantic meaning.
- Use icons when they add meaningful context.
- Keep chip labels concise and descriptive.
- Use borders when additional visual definition is needed.
- Don't use chips for primary actions (use buttons instead).
- Don't use chips for long text content.
- Don't mix too many color variants in a single group.
- Don't use chips without clear purpose or context.
- Don't overcrowd interfaces with too many chips.
- Don't use icons that don't add meaningful information.
Accessibility
- Ensure sufficient color contrast between chip background and text colors.
- Provide clear visual feedback for interactive chip states.
- Use semantic HTML and ARIA attributes when chips are interactive.
- Ensure chips are large enough to be easily clickable (minimum touch target size).
- Provide alternative text or labels for icon-only chips.
- Consider keyboard navigation for chip groups.
API Reference
Chip component props and types.
ChipProps
interface ChipProps {
label?: string;
color?: "primary" | "neutral" | "success" | "critical" | "warning";
size?: "sm" | "md" | "lg";
showBorders?: boolean;
showIcon?: boolean;
onClick?: () => void;
}Props
labelstring"Identifier"color"primary" | "neutral" | "success" | "critical" | "warning""primary"size"sm" | "md" | "lg""md"showBordersbooleanfalseshowIconbooleanfalseonClick() => voidUsage Examples
Copyable code snippets for common chip use cases.
Basic Chip
import { Chip } from 'beacon-ui';
<Chip />Chip with Label
import { Chip } from 'beacon-ui';
<Chip label="Tag" />Chip with Icon
import { Chip } from 'beacon-ui';
import { ListDetailsIcon } from 'beacon-icons';
<Chip
label="Filter"
icon={<ListDetailsIcon size="xs" />}
/>Chip with Border
import { Chip } from 'beacon-ui';
<Chip
label="Selected"
showBorders
/>Color Variants
import { Chip } from 'beacon-ui';
<Chip label="Success" color="success" />
<Chip label="Warning" color="warning" />
<Chip label="Error" color="critical" />
<Chip label="Neutral" color="neutral" />Chip Group
import { Chip } from 'beacon-ui';
<div style={{ display: "flex", gap: "var(--spacing-200)", flexWrap: "wrap" }}>
<Chip label="Tag 1" />
<Chip label="Tag 2" color="success" />
<Chip label="Tag 3" color="warning" />
</div>