Browse components
Size Shift
A box that glides to the size of whatever is inside it. Swap the content and the card eases to its new width and height on a spring while the new content fades up from a blur.
Installation
npx shadcn@latest add @glint-ui/size-shiftFirst time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/size-shift.json
Usage
import { SizeShift } from "@/components/ui/size-shift";
<SizeShift contentKey={step} className="rounded-2xl border bg-card">
{step === "review" ? <ReviewList /> : <UploadPrompt />}
</SizeShift>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| axis | "both" | "height" | "both" | Which sides follow the content. |
| bounce | number | 0.18 | Spring bounce. |
| duration | number | 0.45 | Resize length in seconds. |
| contentKey | ReactNode | — | Change it with the content to fade the new content in. |
| className | string | — | Extra classes for the root element. |