Magic plus
A list with an add button you can drag: drop the plus between two rows and the new item goes exactly there, the rows parting to show where while you move. A tap adds at the end.
When to use
- To-do lists, outlines and checklists where position matters.
- Touch-first lists where inserting in the middle is otherwise fiddly.
When not to use
- Lists sorted automatically; position would be ignored.
- Very long lists that scroll while dragging.
Installation
pnpm dlx shadcn@latest add @caliper/magic-plus
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
MagicPlus
4 props
Also accepts the native props of its root element and a ref.
Keyboard
- ↑
- Moves to the previous item or value.
- ↓
- Moves to the next item or value.
- Escape
- Closes or cancels, then returns focus to where it came from.
- Enter
- Activates the focused control.
- Space
- Activates the focused control.
Accessibility
It is built on native elements and keeps aria-label, aria-hidden and aria-live in step with state. Changes that matter are announced through a live region.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/magic-plus.mdThe index of every part is at /llms.txt.