Grow
A button that grows into the one small form it opens, such as a link to add or a name to save, and shrinks back when you are done.
Examples
| Job | Reason |
|---|---|
| orders_daily | Timeout |
| invoices_weekly | Schema changed |
| sessions_hourly | Timeout |
| refunds_daily | Quota reached |
| accounts_sync | Credentials expired |
Usage
Use it when
- A control asks for one small answer, a line of text or a name, and you should keep your eyes on the control you pressed while you type: the panel grows out of it.
- A toolbar control sits over dense content that must not move, such as a table:
floating.
Use something else when
- The content is a list of commands. Use DropdownMenu instead, which has menu roles and keyboard selection.
- The panel would hold more than 1 field. Use Sheet instead.
- The answer needs a decision with a title, a body and two actions. Use Dialog or AlertDialog instead.
- The panel is informational and anchored to a control without becoming it. Use Popover instead.
- A row of a list, a line of a card or a question opens to its details or its answer. Use Collapsible instead, which owns that job; Grow is for a button that becomes a form.
- The content changes in place without a trigger. Use Swap, Crossfade or TextSwap instead.
Rules
General
Content
Avoid
Limits
Install
npx shadcn@latest add https://kaanarici.com/r/cobalt/grow.jsonimport { Grow } from "@/components/cobalt/ui/grow"