For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
/
144
Sponsor

Format Morph

One asset reframes itself through every aspect ratio while the headline stretches and compresses around it.

Customize
128
20
0.45
40
440
460
0.08
1

Installation

$ pnpm dlx shadcn@latest add @framecn/format-morph

Usage

import { FormatMorph } from "@/components/framecn/format-morph";
<FormatMorph />

The media sits in the middle column of a 1fr auto 1fr grid, so resizing it physically displaces the type on either side. Give it your own asset and wordmark:

<FormatMorph
  src="/product.png"
  lead="SHIP"
  trail="IT"
  stages={[{ ratio: "9:16" }, { ratio: "16:9" }, { ratio: "1:1" }]}
/>

API Reference

FormatMorph

PropTypeDefault
srcstringDEFAULT_SRC
gradientstringDEFAULT_GRADIENT
leadstring"FRA"
trailstring"MECN"
stagesFormatMorphStage[]DEFAULT_STAGES
maxWidthnumber460
maxHeightnumber440
fontSizenumber128
fontWeightnumber | string500
colorstring"#ffffff"
backgroundstring"#4e4e50"
radiusRationumber0.08
holdRationumber0.45
easingstring"quint"
lagMsnumber40
gapnumber20
shadowstring"0 40px 100px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06)"
speednumber1
fpsnumber30
durationInFramesnumber180
widthnumber1280
heightnumber720
classNamestring-

FormatMorphStage

PropTypeDefault
ratiostring-
rotatenumber0
fontSizenumberDerived from the stage's resolved height

MORPH_EASINGS

Named curves accepted by easing, sorted weak to strong. The media is already on screen and changing shape, so every preset is from the ease-in-out family.

NameValue
quadcubic-bezier(0.455, 0.03, 0.515, 0.955)
cubiccubic-bezier(0.645, 0.045, 0.355, 1)
quartcubic-bezier(0.77, 0, 0.175, 1)
quintcubic-bezier(0.86, 0, 0.07, 1)
circcubic-bezier(0.785, 0.135, 0.15, 0.86)
expocubic-bezier(1, 0, 0, 1)
linearlinear

easing also accepts any raw CSS easing value, so easing="cubic-bezier(0.34, 1.56, 0.64, 1)" gives the morph an overshoot.

Notes