← All components
Grow from Origin
ScaleFade + scale (~0.85 → 1) anchored to a transform-origin corner — the dropdown/popover entrance.
menu
menu
menu
menu
Installation
One command drops the source into your repo — editable, with the provider and motion pulled in automatically.
npx shadcn add https://motion.asmitsah.dev/r/grow-from-origin.jsonPrerequisiteInstall the provider base first
This component imports from @/lib/motion and needs <MotionProvider> mounted in your root layout — install the base once, before copying this component.
npx shadcn add https://motion.asmitsah.dev/r/provider.jsonStep 1Install the runtime dependency
npm install motionStep 2Copy the source into
components/motion/grow-from-origin.tsxcomponents/motion/grow-from-origin.tsx
Usage
Basic
Fade + scale ~0.85 → 1, anchored to origin. Plays on mount by default — the dropdown/tooltip/popover entrance.
Origin
Anchor the grow to any of 9 corners/edges/center to match where the trigger sits.
Trigger on scroll
Scope it to viewport entry instead of mount — for a card that grows in as the page scrolls.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | The popover/menu content that grows in, anchored to origin. |
| origin | "top" | "top-left" | "top-right" | "bottom" | "bottom-left" | "bottom-right" | "left" | "right" | "center" | "top" | The transform-origin corner/edge/center it scales up from. |
| trigger | "inView" | "mount" | "mount" | Menus/tooltips play on mount by default; pass trigger="inView" to scope it to scroll entry instead. |
| className | string | — | Passed straight through — GrowFromOrigin becomes your layout element. |
| style | CSSProperties | — | Inline style passthrough. |
| delay | number | 0 | Seconds before this instance animates. |