Text
Duostrap typography component preserving archived heading metrics, the 20/14 body line-height ratio, and all eight Base Text axes.
Duostrap Text realizes Base Text with classic Helvetica Neue / Arial and Monaco / Menlo font stacks while preserving the archived 2xl heading scale and 20/14 body line-height rhythm across all eight typography axes.
Preview
Section titled “Preview”<article class="flex max-w-xl flex-col gap-3">
<h2>
<proto-ui-duostrap-text
size="2xl"
font="heading"
weight="bold"
leading="relaxed"
tracking="tight"
>
Classic Duostrap Heading (24.5px / 40px)
</proto-ui-duostrap-text>
</h2>
<p>
<proto-ui-duostrap-text size="xl" font="body" leading="relaxed">
A crisp lead paragraph introduces the page before settling
into the classic 20/14 body line-height rhythm.
</proto-ui-duostrap-text>
</p>
<p>
<proto-ui-duostrap-text
size="base"
font="body"
leading="normal"
>
Body copy renders with Helvetica Neue, Helvetica, and Arial at
the archived 1.4286 line-height ratio so dense forms and
tables remain balanced.
</proto-ui-duostrap-text>
</p>
<div class="flex flex-wrap items-center gap-3 pt-1">
<code>
<proto-ui-duostrap-text
size="sm"
font="mono"
tracking="tight"
decoration="underline"
>
@proto.ui/prototypes-duostrap/text
</proto-ui-duostrap-text>
</code>
<proto-ui-duostrap-text
size="sm"
tone="muted"
emphasis="italic"
>
Muted helper copy · #666666
</proto-ui-duostrap-text>
</div>
</article>Installation
Section titled “Installation”Currently available from workspace source only; available starting in 0.3.0-rc.1 and later releases. Import textRoot (also exported as duostrapTextRoot and DuostrapTextRoot) from @proto.ui/prototypes-duostrap/text, or generate workspace facades with the duostrap-text CLI target.
import * as React from 'react';import { createReactAdapter } from '@proto.ui/adapter-react';import { duostrapTextRoot } from '@proto.ui/prototypes-duostrap/text';
const Text = createReactAdapter(React)(duostrapTextRoot, { rootTag: 'span' });
export function PageHeading() { return ( <h2> <Text size="2xl" font="heading" weight="bold" leading="relaxed"> Overview </Text> </h2> );}Preserved Duostrap metrics and semantics
Section titled “Preserved Duostrap metrics and semantics”- Archived scale & rhythm:
size="2xl"maps to1.53125rem(24.5pxat a 16px root);leading="normal"uses the classic20/14(1.4286) ratio; pairingsize="2xl"withleading="relaxed"resolves to2.5rem(40px). All metrics scale cleanly inrem. - Leading precedence & defaults: Explicit
leadingvalues override the composite line-height implied bysize, whileleading="size"preserves each size’s line box.leading="tighter"maps to1.1andtracking="tighter"maps to-0.05em. Removing any prop restores its default. - Color inheritance & selection: Set
tone="inherit"inside colored surfaces or buttons so text inherits foreground ink and text-shadow cleanly. Text never overridesuser-select, keeping prose selectable while respecting interactive control selection policies. - Native semantics: Wrap with native
h1–h6,p,label,a, orbuttonelements for document and interactive semantics.
Examples
Section titled “Examples”Archived scale and 20/14 line-height rhythm
Section titled “Archived scale and 20/14 line-height rhythm”Demonstrates 4xl, 3xl, archived 2xl (24.5px / 40px), xl, base (20/14 normal leading), sm, and xs.
<div class="flex max-w-xl flex-col gap-3">
<h1>
<proto-ui-duostrap-text
size="4xl"
font="heading"
weight="bold"
leading="tighter"
tracking="tighter"
>
4xl · Display Heading (leading="tighter")
</proto-ui-duostrap-text>
</h1>
<h1>
<proto-ui-duostrap-text
size="3xl"
font="heading"
weight="bold"
leading="tight"
>
3xl · Page Title
</proto-ui-duostrap-text>
</h1>
<h2>
<proto-ui-duostrap-text
size="2xl"
font="heading"
weight="bold"
leading="relaxed"
>
2xl · Archived 24.5px Scale with 40px Relaxed Line Box
</proto-ui-duostrap-text>
</h2>
<h3>
<proto-ui-duostrap-text
size="xl"
font="heading"
weight="semibold"
leading="size"
>
xl · Section Subheading (leading="size")
</proto-ui-duostrap-text>
</h3>
<p>
<proto-ui-duostrap-text
size="base"
font="body"
leading="normal"
>
base · Body copy with classic 20/14 (1.4286) normal leading
</proto-ui-duostrap-text>
</p>
<small>
<proto-ui-duostrap-text
size="sm"
font="body"
weight="medium"
leading="size"
>
sm · Compact form help & table cell copy
</proto-ui-duostrap-text>
</small>
<small>
<proto-ui-duostrap-text size="xs" tone="muted" leading="size">
xs · Footnote & badge label
</proto-ui-duostrap-text>
</small>
</div>Lead copy, quotes, and inline code
Section titled “Lead copy, quotes, and inline code”Demonstrates lead intro copy, italic blockquotes, monospace code tokens, underlined links, and strikethrough text.
<div class="flex max-w-xl flex-col gap-4">
<p>
<proto-ui-duostrap-text size="xl" leading="relaxed">
Lead copy makes an introductory paragraph stand out with
generous line spacing.
</proto-ui-duostrap-text>
</p>
<blockquote class="border-s-4 border-border ps-4">
<proto-ui-duostrap-text emphasis="italic" leading="normal">
"Simplicity and predictable typography keep web applications
timeless."
</proto-ui-duostrap-text>
</blockquote>
<div class="flex flex-wrap items-center gap-3">
<code class="rounded bg-muted px-2 py-0.5">
<proto-ui-duostrap-text size="sm" font="mono" leading="size">
DuostrapTextRoot
</proto-ui-duostrap-text>
</code>
<a href="#api">
<proto-ui-duostrap-text size="sm" decoration="underline">
Browse API reference
</proto-ui-duostrap-text>
</a>
<del>
<proto-ui-duostrap-text
size="sm"
tone="muted"
decoration="line-through"
>
Deprecated .muted class
</proto-ui-duostrap-text>
</del>
</div>
</div>Classic surfaces and foreground inheritance
Section titled “Classic surfaces and foreground inheritance”Compares tone="inherit", default, and muted over Duostrap primary gradient (solid), info (accent), and classic white (outline) surfaces.
<div class="grid max-w-xl grid-cols-1 gap-3 sm:grid-cols-3">
<proto-ui-duostrap-surface
variant="solid"
elevation="raised"
border="all"
>
<div class="flex flex-col gap-1 p-3">
<proto-ui-duostrap-text
size="sm"
weight="bold"
tone="inherit"
>
Primary Gradient
</proto-ui-duostrap-text>
<proto-ui-duostrap-text size="xs" tone="inherit">
tone="inherit" preserves white ink & shadow.
</proto-ui-duostrap-text>
</div>
</proto-ui-duostrap-surface>
<proto-ui-duostrap-surface variant="accent" border="all">
<div class="flex flex-col gap-1 p-3">
<proto-ui-duostrap-text
size="sm"
weight="bold"
tone="inherit"
>
Info Accent
</proto-ui-duostrap-text>
<proto-ui-duostrap-text size="xs" tone="inherit">
Follows classic #d9edf7 tint foreground.
</proto-ui-duostrap-text>
</div>
</proto-ui-duostrap-surface>
<proto-ui-duostrap-surface
variant="outline"
elevation="raised"
border="all"
>
<div class="flex flex-col gap-1 p-3">
<proto-ui-duostrap-text
size="sm"
weight="bold"
tone="default"
>
Default Well
</proto-ui-duostrap-text>
<proto-ui-duostrap-text size="xs" tone="muted">
Muted #666666 caption on white.
</proto-ui-duostrap-text>
</div>
</proto-ui-duostrap-surface>
</div>The following props belong to Root (DuostrapTextRoot):
| Prop | Type | Default | Description |
|---|---|---|---|
size | 'xs' 'sm' 'base' 'lg' 'xl' '2xl' '3xl' '4xl' '5xl' | base | Font size scale; 2xl preserves the archived 1.53125rem (24.5px) step |
tone | 'default' 'muted' 'inherit' | default | Ink tone; pass inherit inside colored surfaces or buttons |
weight | 'normal' 'medium' 'semibold' 'bold' | normal | Font weight |
font | 'body' 'heading' 'mono' | body | Font stack (Helvetica Neue / Arial or Monaco / Menlo monospace) |
leading | 'size' 'tighter' 'tight' 'snug' 'normal' 'relaxed' | normal | Line height; normal uses 20/14 ratio, 2xl + relaxed is 2.5rem (40px), tighter is 1.1 |
tracking | 'normal' 'tight' 'tighter' | normal | Letter spacing; tight maps to -0.025em and tighter maps to -0.05em |
emphasis | 'normal' 'italic' | normal | Normal or italic font style |
decoration | 'none' 'underline' 'line-through' | none | Text decoration line |