Font Changer

Interactive typography studio and live font switcher supporting 34 curated Google Fonts, instant live previews, global persistence, and sleek modal controls.

Inter

Click to open the Typography Studio and test 30+ Google fonts live.

1import * as React from "react";
2import FontChanger, { FontInitializer } from "@/components/font-changer/FontChanger";
3 
4export default function App() {
5 return (
6 <>
7 {/* Silent client-side loader that applies saved font preferences immediately */}
8 <FontInitializer />
9 
10 <main className="min-h-screen p-8 flex flex-col items-center justify-center">
11 <h1 className="text-4xl font-bold tracking-tight">Typography Studio</h1>
12 <p className="mt-2 text-muted-foreground text-center max-w-md">
13 Experiment with 30+ curated serif, sans, display, handwriting, and monospace typefaces in real time.
14 </p>
15 
16 {/* Can be mounted as inline toolbar button or floating edge trigger */}
17 <div className="mt-6">
18 <FontChanger variant="inline" />
19 </div>
20 </main>
21 
22 {/* Floating edge trigger */}
23 <FontChanger variant="fixed" />
24 </>
25 );
26}

Installation

bunx --bun shadcn@latest add https://www.ashutoshtiwari.is-a.dev/r/font-changer.json

Usage

1import FontChanger, { FontInitializer } from "@/components/font-changer/FontChanger"
1<FontChanger />

API Reference

PropTypeDefaultDescription
variant"fixed" | "inline""fixed"

Trigger placement style: 'fixed' docks as a floating island pill at the bottom-left screen edge, while 'inline' embeds in normal document flow.

defaultFontstring"Inter"

Default fallback Google Font family to load initially.

defaultPreviewTextstring"The quick brown fox jumps over the lazy dog."

Initial custom preview sentence rendered in the modal preview pane.

showTriggerbooleantrue

Whether to render the trigger button automatically alongside the modal.

classNamestring""

Custom CSS classes applied to the trigger wrapper element.