Skip to content

    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.

    Open
    Customize
    both
    height

    Installation

    npx shadcn@latest add @glint-ui/size-shift

    First 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

    PropTypeDefaultDescription
    axis"both" | "height""both"Which sides follow the content.
    bouncenumber0.18Spring bounce.
    durationnumber0.45Resize length in seconds.
    contentKeyReactNode—Change it with the content to fade the new content in.
    classNamestring—Extra classes for the root element.