Skip to content
Textlab
1
Browse

ComponentsPhysics

Breathing text

Weight breathes in and out over time.

Inhale, exhale

Installation

$ npx shadcn@latest add @textlab/breathing-text

Needs @textlab in your components.json. Setup takes a minute.

Usage

usage.tsx
import { BreathingText } from "@/components/textlab/breathing-text/breathing-text";

<BreathingText as="h2" text="Inhale, exhale" />

Variants

breatheheartbeat

Props

PropTypeDefaultDescription
text*string–The copy.
variant"breathe" | "heartbeat""breathe"A slow swell through the word, or a double thump and rest.
fromnumber250Weight at rest.
tonumber800Weight at the peak.
speednumber3.6Seconds per breath.
fontstringvar(--tl-font-flex)A variable font with a weight axis.
asElementType"span"Rendered element.
reducedMotion"user" | "always" | "never""user"user follows the OS setting; always shows the still version.
classNamestring–Merged onto the root.

When to use it

Reach for it

  • Meditation, health and calm brands.
  • Idle and waiting states that should feel alive, not busy.

Skip it

  • Fonts without a weight axis.
  • Layouts where width changes would push neighbours.

Accessibility and motion

Accessibility

  • Letters are aria-hidden; the text is read once.
  • Slow and continuous, with no flashing.

Motion

  • The breath travels through the word 90 ms per letter.
  • Heartbeat thumps twice in the first 40% of each cycle, then rests.
Reduced motion. A still word at a medium weight.

Performance

  • A registered CSS property drives font-variation-settings; text reflows within the line each frame, so use it on short words.