Text
采用 DM Sans 字体与高对比度色阶的 Brutalist 排版文本组件。
Brutalist Text 基于 Base Text 提供全部八项独立排版属性,使用 DM Sans 字体族(正文 500、标题 700)与高对比度前景色,并遵循 Brutalist 设计契约保持纯被动、无阴影与无多余动效。
Web Components React Vue Vue 2
正在加载交互示例… 正文和源码已可阅读,交互控件就绪后会显示在这里。
<article class="flex max-w-xl flex-col gap-4">
<h1>
<proto-ui-brutalist-text
size="4xl"
font="heading"
weight="bold"
leading="tight"
tracking="tight"
>
Bold Print. Zero Ambiguity.
</proto-ui-brutalist-text>
</h1>
<p>
<proto-ui-brutalist-text
size="base"
font="body"
weight="medium"
leading="relaxed"
>
Brutalist typography pairs DM Sans 700 headings with DM Sans
500 body copy while keeping text passive, shadowless, and
effortlessly selectable.
</proto-ui-brutalist-text>
</p>
<p>
<proto-ui-brutalist-text
size="sm"
tone="muted"
weight="medium"
emphasis="italic"
>
"Strong hierarchy comes from weight and scale, not decorative
clutter."
</proto-ui-brutalist-text>
</p>
<div class="flex flex-wrap items-center gap-3">
<code>
<proto-ui-brutalist-text
size="sm"
font="mono"
weight="semibold"
tracking="tight"
decoration="underline"
>
npx @proto.ui/cli add wc brutalist-text
</proto-ui-brutalist-text>
</code>
<proto-ui-brutalist-text size="xs" tone="muted" weight="medium">
DM Sans 500 / 700
</proto-ui-brutalist-text>
</div>
</article>当前在源码工作区提供,将于 0.3.0-rc.1 及后续版本中提供。可使用工作区 CLI 目标 brutalist-text 生成本地封装,或直接从 @proto.ui/prototypes-brutalist/text 导入 brutalistTextRoot(同时提供 textRoot 与 BrutalistTextRoot 别名):
npx @proto.ui/cli@latest add wc brutalist-text
pnpm dlx @proto.ui/cli@latest add wc brutalist-text
将命令中的 wc 替换为 react、vue 或 vue2,即可生成对应框架的封装。
import { BrutalistTextRoot } from '../proto-ui/components/react';
export function SectionTitle() { return ( <h1> <BrutalistTextRoot size="4xl" font="heading" weight="bold" leading="tight" tracking="tight"> Account settings </BrutalistTextRoot> </h1> );}语义包裹与设计契约
Section titled “语义包裹与设计契约”- DM Sans 层级规范:常规正文与控件标签推荐
font="body" weight="medium"(DM Sans 500),标题与突出标签推荐font="heading" weight="bold"(DM Sans 700);Text 自身不添加硬边框或阴影。 - 外层原生语义:标题层级(
h1–h6)、段落(p)、表单标签(label)与链接(a)由外层原生元素负责,Text 保持自然可选且不添加焦点停靠点。 - 字号行高与默认值:
leading="size"保留字号内建行高(xs1rem至5xl1);leading="tighter"对应1.1,tracking="tighter"对应-0.05em。移除属性会恢复默认值;初始非法size回退为base,已有合法值后更新非法值则保留上一个有效值。
DM Sans 字号与字重刻度
Section titled “DM Sans 字号与字重刻度”展示从 5xl 海报标题到 xs 紧凑标注的 DM Sans 700 / 500 层级。
Web Components React Vue Vue 2
正在加载交互示例… 正文和源码已可阅读,交互控件就绪后会显示在这里。
<div class="flex max-w-xl flex-col gap-3">
<h1>
<proto-ui-brutalist-text
size="5xl"
font="heading"
weight="bold"
leading="tighter"
tracking="tighter"
>
5xl · Poster Headline
</proto-ui-brutalist-text>
</h1>
<h2>
<proto-ui-brutalist-text
size="3xl"
font="heading"
weight="bold"
leading="tight"
tracking="tight"
>
3xl · Section Title (DM Sans 700)
</proto-ui-brutalist-text>
</h2>
<h3>
<proto-ui-brutalist-text
size="xl"
font="heading"
weight="bold"
leading="snug"
>
xl · Card Header
</proto-ui-brutalist-text>
</h3>
<p>
<proto-ui-brutalist-text
size="base"
font="body"
weight="medium"
leading="normal"
>
base · Body & control text (DM Sans 500)
</proto-ui-brutalist-text>
</p>
<small>
<proto-ui-brutalist-text
size="sm"
font="body"
weight="medium"
leading="size"
>
sm · 14px / 20px standard control label
</proto-ui-brutalist-text>
</small>
<small>
<proto-ui-brutalist-text
size="xs"
font="body"
tone="muted"
weight="medium"
leading="size"
>
xs · 12px / 16px compact badge & caption
</proto-ui-brutalist-text>
</small>
</div>导语、引文与行内样式
Section titled “导语、引文与行内样式”展示导语、引文块、行内等宽标签、下划线链接与删除线等常用排版组合。
Web Components React Vue Vue 2
正在加载交互示例… 正文和源码已可阅读,交互控件就绪后会显示在这里。
<div class="flex max-w-xl flex-col gap-4">
<p>
<proto-ui-brutalist-text
size="xl"
tone="muted"
weight="medium"
leading="relaxed"
>
Lead summary copy sets expectations before the reader dives
into detailed specs.
</proto-ui-brutalist-text>
</p>
<blockquote class="border-s-4 border-border ps-4">
<proto-ui-brutalist-text
weight="medium"
emphasis="italic"
leading="relaxed"
>
"Keep decorative borders on structural frames, never on
passive text."
</proto-ui-brutalist-text>
</blockquote>
<div class="flex flex-wrap items-center gap-3">
<code class="rounded bg-muted px-2 py-0.5">
<proto-ui-brutalist-text
size="sm"
font="mono"
weight="semibold"
leading="size"
>
BRUTALIST_THEME
</proto-ui-brutalist-text>
</code>
<a href="#api">
<proto-ui-brutalist-text
size="sm"
weight="bold"
decoration="underline"
>
Read API props
</proto-ui-brutalist-text>
</a>
<del>
<proto-ui-brutalist-text
size="sm"
tone="muted"
decoration="line-through"
>
Deprecated label
</proto-ui-brutalist-text>
</del>
</div>
</div>强调色表面与前景色继承
Section titled “强调色表面与前景色继承”在 #5294ff 主色或强调色 Surface 上搭配 tone="inherit",确保黑色前景墨水在亮暗模式下都清晰可读。
Web Components React Vue Vue 2
正在加载交互示例… 正文和源码已可阅读,交互控件就绪后会显示在这里。
<div class="grid max-w-xl grid-cols-1 gap-4 sm:grid-cols-2">
<proto-ui-brutalist-surface
variant="solid"
elevation="raised"
border="all"
>
<div class="flex flex-col gap-1 p-4">
<proto-ui-brutalist-text
size="base"
font="heading"
weight="bold"
tone="inherit"
>
Main Surface (#5294ff)
</proto-ui-brutalist-text>
<proto-ui-brutalist-text
size="sm"
weight="medium"
tone="inherit"
>
tone="inherit" keeps crisp black ink over accent fills.
</proto-ui-brutalist-text>
</div>
</proto-ui-brutalist-surface>
<proto-ui-brutalist-surface
variant="secondary"
elevation="raised"
border="all"
>
<div class="flex flex-col gap-1 p-4">
<proto-ui-brutalist-text
size="base"
font="heading"
weight="bold"
tone="default"
>
Secondary Card Surface
</proto-ui-brutalist-text>
<proto-ui-brutalist-text
size="sm"
weight="medium"
tone="muted"
>
Pairs default foreground headings with muted captions.
</proto-ui-brutalist-text>
</div>
</proto-ui-brutalist-surface>
</div>以下属性属于 Root(BrutalistTextRoot):
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
size | 'xs' 'sm' 'base' 'lg' 'xl' '2xl' '3xl' '4xl' '5xl' | base | 字号刻度 |
tone | 'default' 'muted' 'inherit' | default | 前景色语义;在强调色 Surface 内设为 inherit |
weight | 'normal' 'medium' 'semibold' 'bold' | normal | 字重(正文推荐 medium,标题推荐 bold) |
font | 'body' 'heading' 'mono' | body | 字体族(DM Sans 正文/标题或等宽字体) |
leading | 'size' 'tighter' 'tight' 'snug' 'normal' 'relaxed' | normal | 行高;size 保留字号内建行高,tighter 为 1.1 |
tracking | 'normal' 'tight' 'tighter' | normal | 字距;tight 为 -0.025em,tighter 为 -0.05em |
emphasis | 'normal' 'italic' | normal | 正体或斜体样式 |
decoration | 'none' 'underline' 'line-through' | none | 文本装饰线 |