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/calligraphyQuick 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
Variants
All 12 variants mapped to their semantic HTML tag and type scale.
The craft of typography
Page-level heading
Section heading
Sub-section heading
Card heading
Small heading
Micro heading
Supporting subtitle for a section
Body copy for reading at length. Well-crafted typography improves comprehension.
<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.
riseSmooth upward fade-in
staggerWord-by-word entrance
clipUnmasked left to right
popSpring scale-in
lettersLetter-by-letter slide
blurEmerges from a blur
flip3D perspective rotate
swipeSlides from the right
typewriterCharacter reveal
bounceDrop 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
| Prop | Type | Default | Description |
|---|---|---|---|
variant | TypographyVariant | "Body" | Typography scale — Display through Caption |
font | string | — | Google Font name. Auto-injects the <link> tag. |
color | string | — | Any valid CSS color value |
align | "left" | "center" | "right" | "justify" | — | Text alignment |
animation | HeroAnimation | — | Entrance animation. Display / H1 only. |
italic | boolean | true | Render <em> children in Instrument Serif italic |
accentColor | string | "#c8b89a" | Color for the italic <em> accent span |
as | ElementType | — | Override the rendered HTML tag |
truncate | boolean | false | Single-line ellipsis truncation |
maxLines | number | — | Multi-line clamp with ellipsis |
className | string | — | Additional class names |
style | CSSProperties | — | Inline style overrides |