blaze-motion
← All components

Scale X Reveal

Scale

A rule / divider draws open — scaleX 0 → 1 + fade from the left.

Section

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/scale-x-reveal.json

Usage

Basic

Self-contained by default — no children needed. Draws scaleX 0 → 1 with a fade, anchored left.

import { ScaleXReveal } from "@/components/motion/scale-x-reveal";

<ScaleXReveal className="h-px w-full bg-border" />

With a label

Put text in an inner un-scaled span — ScaleXReveal scales the whole element horizontally, which would otherwise squash text as it draws in.

<div className="flex items-center gap-3">
  <span>Section</span>
  <ScaleXReveal className="h-px flex-1 bg-signal" />
</div>

With delay

Offset a rule from its neighbors by a beat.

<ScaleXReveal delay={0.15} className="h-0.5 w-24 rounded-full bg-signal" />

Trigger on mount

Skip the scroll-into-view check and draw immediately — useful above the fold or inside a modal.

<ScaleXReveal trigger="mount" className="h-px w-full bg-border" />

Props

PropTypeDefaultDescription
childrenReactNodeUsually omitted — pass this in an inner un-scaled span if you do, so text doesn't squash as the width draws in.
classNamestringPassed straight through — ScaleXReveal becomes your layout element (e.g. a rule or underline).
styleCSSPropertiesInline style passthrough; merges with the internal transformOrigin.
delaynumber0Seconds before this instance animates.
trigger"inView" | "mount""inView"Draw open the first time it's 30% in view, or immediately on mount.