Refine the space between letters
Pair review · Georgia
Edits supplied glyph-pair offsets in font units, with baseline and edited previews, bounded keyboard nudging, and one-step undo.
Pair review · Georgia
Three ways in. They share one source, so the pixels match whichever you pick.
npm install @noorddev/vlak-react
// once, next to your app's root
import "@noorddev/vlak-react/css";
import { KerningPairEditor } from "@noorddev/vlak-react";Precompiled React and one stylesheet. No compiler to configure. Per-component imports work too: @noorddev/vlak-react/components/kerning-pair-editor.
npx @noorddev/vlak-cli add kerning-pair-editor
The StyleX leaf lands in components/vlak/ with its dependencies, for your own compiler to own. See StyleX.
npx shadcn add https://vlak.dev/r/kerning-pair-editor.json
The same registry item, installed by shadcn's CLI.
<link rel="stylesheet" href="node_modules/@noorddev/vlak/css/vlak.css" />
No React. Link vlak.css and use the markup and classes below.
import { KerningPairEditor } from "@noorddev/vlak-react";
<KerningPairEditor label="Pair spacing" name="kerning" fontFamily="Georgia, serif" unitsPerEm={1000}
pairs={[{ id: "av", left: "A", right: "V" }, { id: "to", left: "T", right: "o" }]}
baselineOffsets={{ av: -60, to: -40 }} defaultValue={{ av: -80, to: -50 }} />Explicit pair offsets with browser font previews, without font-file editing or shaping.
| Prop | Type | Default | Description |
|---|---|---|---|
labelrequired | ReactNode | ||
pairsrequired | KerningPair[] | ||
fontFamilyrequired | string | ||
unitsPerEmrequired | number | ||
baselineOffsets | KerningOffsets | {} | |
value | KerningOffsets | ||
defaultValue | KerningOffsets | {} | |
onValueChange | (offsets: KerningOffsets) => void | ||
activePairId | string | null | ||
defaultActivePairId | string | null | ||
onActivePairChange | (id: string | null) => void | ||
min | number | -unitsPerEm | |
max | number | unitsPerEm | |
readOnly | boolean |
Also accepts Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "defaultValue" | "onChange">.
| Keys | Does |
|---|---|
| Tab | Moves through the pair selector, navigation, offset editor, reset, and undo actions. |
| Arrow left, Arrow right | Nudges the focused offset by one font unit within the supplied bounds. |
| Shift + Arrow left, Shift + Arrow right | Nudges the focused offset by ten font units. |
| Enter, Space | Activates the focused previous, next, reset, or undo button. |
<fieldset class="rs-kerning-pair-editor"><legend class="rs-kerning-pair-editor-legend">Pair spacing</legend><div class="rs-kerning-pair-editor-previews"><figure class="rs-kerning-pair-editor-preview"><figcaption class="rs-kerning-pair-editor-note">Edited: -80 units</figcaption><div class="rs-kerning-pair-editor-glyphs" style="font-family:Georgia,serif" role="img" aria-label="A followed by V, edited offset -80 units"><span class="rs-kerning-pair-editor-glyph" aria-hidden="true">A</span><span class="rs-kerning-pair-editor-glyph" aria-hidden="true" style="margin-inline-start:-0.08em">V</span></div></figure></div><label class="rs-kerning-pair-editor-field">Offset (font units)<input class="rs-input rs-input-full rs-kerning-pair-editor-input" type="number" value="-80" min="-1000" max="1000" step="any" /></label></fieldset>