Bubble pack
Choices as bubbles sized by weight, packed together like froth. They pop in from the middle and settle; the one under the pointer or focus swells and nudges its neighbours; chosen bubbles take the accent. Drag one to fling it and the rest make room.
2 selected
When to use
- Picking interests, topics or skills during onboarding.
- Tags where weight matters, such as followers or usage.
When not to use
- More than about 20 choices; use a searchable multi-select.
- Choices people need to compare by label in order.
Installation
pnpm dlx shadcn@latest add @caliper/bubble-pack
Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
BubblePack
5 props
Also accepts the native props of its root element and a ref.
Keyboard
- No custom key handling; Tab and the native activation keys do the work.
Accessibility
It exposes group semantics, with aria-label and aria-pressed kept in step with state.
Motion
- State changes animate with the library's shared durations and curves, so its timing matches every other part.
- Under reduced motion each change lands on its end state without movement; nothing is hidden or skipped.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/bubble-pack.mdThe index of every part is at /llms.txt.