Components
Chip
Pressable filter chips and removable tokens.
Ombelle · light
Chip
glass
Installation
Run in a project initialized with an Ombelle preset (see Get started). The component uses the saved project preset. Run the command from your app folder; it shows the changes and asks before writing.
pnpm dlx @ombelle-ui/cli@1.1.2 add chipAdds components/ui/chip.tsx and installs react, clsx, tailwind-merge, lucide-react with lifecycle scripts disabled. This is a client component.
In a liquid glass project the plan adds a notice that accessibility is not guaranteed, because text contrast depends on the background behind the glass.
Usage
example.tsx
import { Chip, ChipGroup, ChipRemove } from '@/components/ui/chip'
export function Example(){return <div style={{ display: "flex", alignItems: "center", flexWrap: "wrap", gap: "0.75rem" }}><ChipGroup aria-label="Status filter"><Chip defaultPressed>On track</Chip><Chip defaultPressed={false}>Shipped</Chip></ChipGroup><Chip>glass<ChipRemove /></Chip></div>}API and states
- API
- Chip (pressed, defaultPressed, onPressedChange), ChipRemove (label, onRemove), ChipGroup
- Minimum states
- Pressed, static, removable, disabled, focus
- Native basis
- Native button with aria-pressed, and a span with a remove button
- Styles
- Stable in Ombelle, Papier, Organic, Retro futurism, minimalist, neo-brutalism and flat, light and dark. Liquid glass: stable, accessibility not guaranteed.