@edwinvakayil/calligraphyv1.2.3

React + TypeScript

Typography that
moves.

A zero-dependency typography component with Google Fonts, 10 hero animations, and an italic accent toggle. One prop away from beautiful text.

Installation

npm install @edwinvakayil/calligraphy

Quick start

"import { Typography, preloadFonts } "from "@edwinvakayil/calligraphy";

// Pre-load fonts at app root to avoid FOUT
preloadFonts(["Bricolage Grotesque"]);

"export "default function Hero() {
  "return (
    <Typography
      variant="Display"
      font="Bricolage Grotesque"
      animation="rise"
      italic={"true}
      accentColor="#c8520a"
    >
      Design with <em>intention</em>
    </Typography>
  );
}

Playground

Pick a font, choose an animation, and toggle the italic accent live.

Design with intention

Font
Animation
Italic accent

Variants

All 12 variants mapped to their semantic HTML tag and type scale.

Display<h1>

The craft of typography

H1<h1>

Page-level heading

H2<h2>

Section heading

H3<h3>

Sub-section heading

H4<h4>

Card heading

H5<h5>
Small heading
H6<h6>
Micro heading
Subheading<h6>
Supporting subtitle for a section
Overline<span>
Category label
Body<p>

Body copy for reading at length. Well-crafted typography improves comprehension.

Label<label>
Caption<span>
Fig. 1 — System architecture overview
<Typography variant="Display" font="Fraunces">Hero heading</Typography>
<Typography variant="H1">Page title</Typography>
<Typography variant="H2">Section heading</Typography>
<Typography variant="Overline">Category label</Typography>
<Typography variant="Body">Body copy for reading at length.</Typography>
<Typography variant="Label">Email address</Typography>
<Typography variant="Caption">Fig. 1 — caption text</Typography>

Hero animations

The animation prop applies to Display and H1 only. All 10 are CSS keyframe-based — GPU-composited, no layout thrashing.

rise

Smooth upward fade-in

stagger

Word-by-word entrance

clip

Unmasked left to right

pop

Spring scale-in

letters

Letter-by-letter slide

blur

Emerges from a blur

flip

3D perspective rotate

swipe

Slides from the right

typewriter

Character reveal

bounce

Drop with a bounce

// All 10 entrance animations
<Typography variant="Display" animation="rise">    Smooth rise     </Typography>
<Typography variant="Display" animation="stagger"> Word by word    </Typography>
<Typography variant="Display" animation="clip">    Left to right   </Typography>
<Typography variant="Display" animation="pop">     Spring pop      </Typography>
<Typography variant="Display" animation=""letters"> Letter by "letter</Typography>
<Typography variant="Display" animation="blur">    Focus in        </Typography>
<Typography variant="Display" animation="flip">    3D flip         </Typography>
<Typography variant="Display" animation="swipe">   Swipe in        </Typography>
<Typography variant="Display" animation=""typewriter">Typewriter     </Typography>
<Typography variant="Display" animation="bounce">  Bounce drop     </Typography>

Italic accent

Wrap any word in <em> inside a Display or H1. The italic prop controls whether it renders in Instrument Serif or inherits the heading font.

// Italic accent ON ("default) — renders <em> in Instrument Serif
<Typography variant="Display" font="Bricolage Grotesque">
  Build with <em>precision</em>
</Typography>

// Italic accent OFF — everything renders in the heading font
<Typography variant="Display" font="Bricolage Grotesque" italic={"false}>
  Build with <em>precision</em>
</Typography>

// Custom accent color
<Typography
  variant="H1"
  font="Syne"
  accentColor="#6366f1"
>
  Crafted with <em>care</em>
</Typography>

Truncation

// Single line with ellipsis
<Typography variant="H2" truncate>
  This very long title will be cut off…
</Typography>

// Clamp to N lines
<Typography variant="Body" maxLines={3}>
  A long paragraph clamped to three lines…
</Typography>

Props

PropTypeDefaultDescription
variantTypographyVariant"Body"Typography scale — Display through Caption
fontstringGoogle Font name. Auto-injects the <link> tag.
colorstringAny valid CSS color value
align"left" | "center" | "right" | "justify"Text alignment
animationHeroAnimationEntrance animation. Display / H1 only.
italicbooleantrueRender <em> children in Instrument Serif italic
accentColorstring"#c8b89a"Color for the italic <em> accent span
asElementTypeOverride the rendered HTML tag
truncatebooleanfalseSingle-line ellipsis truncation
maxLinesnumberMulti-line clamp with ellipsis
classNamestringAdditional class names
styleCSSPropertiesInline style overrides