Text
Shadcn passive text content and reusable typography inputs.
Ordinary demos on this page explicitly use Shadcn Rhea, with matching examples. This does not change public compatibility defaults or imply complete browser, native-host or visual acceptance. Neutral Surface/Text atoms retain their own public semantics; the consumer composition supplies the family presentation theme.
shadcn-text-root is a draft reusable Text atom. It inherits the Base Text input vocabulary and content slot through asTextRoot(). The Shadcn theme owns typography and ink. This is Proto UI’s own Text projection, with no claim of upstream Text-component API parity.
The examples are actual package prototypes. Their outer stack supplies only demonstration layout; each Text instance owns its content and its applicable presentation. The examples add no click handlers or editing state.
Use Text
Section titled “Use Text”import * as React from 'react';import { createReactAdapter } from '@proto.ui/adapter-react';import { shadcnTextRoot } from '@proto.ui/prototypes-shadcn/text';
const Text = createReactAdapter(React)(shadcnTextRoot, { rootTag: 'span' });
export function SectionTitle() { return ( <h1> <Text size="4xl" font="heading" weight="semibold" leading="tight" tracking="tight"> Account settings </Text> </h1> );}The same subpath and package root also export textRoot and ShadcnTextRoot aliases. Family-aliased types retain the Base input contract.
rootTag: 'span' is Web Adapter configuration, not a Text prop. The surrounding native h1, p, label or a remains the document or interaction owner. For a label, keep htmlFor/for on the native label; for a link, keep href, target and download behavior on the native anchor. Text does not create a second focus stop or synthesize activation.
Inputs
Section titled “Inputs”| Prop | Values | Default |
|---|---|---|
size | xs, sm, base, lg, xl, 2xl, 3xl, 4xl, 5xl | base |
tone | default, muted, inherit | default |
weight | normal, medium, semibold, bold | normal |
font | body, heading, mono | body |
leading | size, tighter, tight, snug, normal, relaxed | normal |
tracking | normal, tight, tighter | normal |
emphasis | normal, italic | normal |
decoration | none, underline, line-through | none |
tone="inherit" keeps the enclosing semantic or Surface owner’s foreground, which is useful for contrast on solid or accent surfaces. Removing a prop restores its default. The single anonymous slot preserves authored text and children. There are no exposed states, methods or events. No page role, copy, heading level, asChild, tag, href, for, content parser, editor, or automatic responsive breakpoint is part of this API.
leading="size" keeps the line box built into the selected size instead of adding a leading override. Shadcn and Brutalist map xs, sm, base, lg, xl, 2xl, 3xl, 4xl, and 5xl to line heights of 1rem, 1.25rem, 1.5rem, 1.75rem, 1.75rem, 2rem, 2.25rem, 2.5rem, and 1 respectively. For example, size="base" uses 16/24 and size="lg" uses 18/28 at a 16px root size. Omitting size restores base. An initially invalid size also falls back to base; a provided empty or invalid size after a valid value retains that previous value under the existing Props contract. leading="tighter" selects 1.1; tracking="tighter" selects -0.05em. The existing normal defaults are unchanged. These options are finite visual semantics, not numeric or arbitrary-CSS inputs. Base only normalizes them; this density extension is verified for Shadcn and Brutalist, not every family or native target.
Shadcn action composition keeps its existing precedence: actionProfile="rhea" or "luma" still selects 1.25rem leading, including when leading="size" or "tighter" is supplied.
Adapter and Compiler boundary
Section titled “Adapter and Compiler boundary”The implemented Web profile is exercised through Web Components, React, Vue 3 and Vue 2, including property changes/removal, retained content and native-owner composition. Web compiler source-closure and generated-facade checks are separate from that Adapter evidence; they do not establish arbitrary Prototype AOT or native parity.
The CLI’s unsupported GPUI target is rejected. Native GPUI typography mapping still omits font-style, letter-spacing and text-decoration-line; those omissions are diagnostic limits, not an equivalent rendering. tone="inherit" currently reports UnsupportedValue(color, inherit) on GPUI. Unknown style tokens report Unsupported Proto UI style tokens rather than silently succeeding. Real-browser visual acceptance and each target’s execution evidence remain distinct from source and DOM tests.
The density values are checked against the pinned shadcn page-header source under its MIT license: the heading uses lg:leading-[1.1] and xl:tracking-tighter, while the description uses size-owned text-base and sm:text-lg line boxes. This is reference evidence for reusable typography choices, not an upstream Text component or a page-specific Text API.
Authority
Section titled “Authority”P-SHADCN-TEXT and T-TEXT-0001 govern this slice. The source is packages/prototypes/shadcn/src/text/. Catalog lifecycle remains draft.
Install
Section titled “Install”
npx @proto.ui/cli@latest add wc shadcn-text
Replace wc with react, vue or vue2 to generate the facade for that host.
| Prop | Type | Default |
|---|---|---|
size | 'xs' 'sm' 'base' 'lg' 'xl' '2xl' '3xl' '4xl' '5xl' | base |
tone | 'default' 'muted' 'inherit' | default |
weight | 'normal' 'medium' 'semibold' 'bold' | normal |
font | 'body' 'heading' 'mono' | body |
leading | 'size' 'tighter' 'tight' 'snug' 'normal' 'relaxed' | normal |
tracking | 'normal' 'tight' 'tighter' | normal |
emphasis | 'normal' 'italic' | normal |
decoration | 'none' 'underline' 'line-through' | none |
These props belong to Root. Text does not synthesize a host role.