项目设置
操作流程
- 选择一个组件。
- 配置您的设置。
- 在浏览器中检查结果。
示例状态存储在 Svelte 组件中。
npm install @woodger/antd 文本、标题和链接可进行复制、编辑和缩短。
Typography 通过复制、编辑或缩短文本来设计文档、标题、签名、链接和段落。根据语义选择一个选项:TypographyTitle 创建所需级别的标题,TypographyText - 行片段,TypographyParagraph - 文本块,TypographyLink - 真实链接。
常规排版默认创建一篇文章,并且可以包装整个文档。文档中的简单本机表格无需交互式 Table 即可使用。
Typography、TypographyText、TypographyTitle、TypographyParagraph 和 TypographyLink 导出到 Svelte。children 接受文本、内容数组或片段。对于文本操作,将源字符串保持在应用程序状态。
| 问题 | 设置 | 示例 |
|---|---|---|
| 创建文档 | Typography、TypographyTitle、TypographyParagraph |
带有排版的文档 |
| 选择标题级别 | TypographyTitle.level |
标题级别 |
| 设计线和链接 | TypographyText、TypographyLink |
文本和链接 |
| 让我改一下线路 | editable |
编辑文本 |
| 添加副本 | copyable |
复制文本 |
type 指定次要/success/warning/危险。code、标记、键盘、下划线、删除、粗斜体改变外观; TypographyTitle 中缺少 Strong。此处 disabled 设置文本样式,但不会自动禁用操作按钮。该链接保留其 href、target 和本机行为。
editable.onChange 报告一个字符串以分配给状态并将其传递回 children。bind:value 丢失。对于托管编辑器,设置 editable.editing 并接受 onStart/onEnd/onCancel;回调本身不会重写您的文本。 指导示例 分别存储模式和结果。
maxLength 和 autoSize 配置编辑字段,triggerType 选择通过图标或文本触发。 actions.placement 将操作放置在 start/end 处。图标和 tooltip 内容接受文本或 Svelte 片段; 动作位置 单独显示。
copyable=true 使用原始内容文本;对于复杂的代码片段,请设置显式的 copyable.text。此属性还接受异步函数。单击时调用该函数; 异步示例 获取缓冲区的当前字符串。格式区分 text/plain 和 text/html,onCopy 报告操作完成情况。对于 HTML,显式传递所需的字符串,而不是等待自动导出代码片段标记。
TypographyText 缩小为一行并且不会自动填充整个宽度:设置 width 约束。 TypographyParagraph/TypographyTitle 支持 rows、可展开和 collapsible、suffix 和展开/onExpand 控件。 defaultExpanded 仅指定初始扩展; onEllipsis 报告减少的事实。
缩短长文本 显示不同的宽度和线条。 受控披露 商店单独扩展。要扩展文件名,请将尾部放在 suffix 中;tooltip 和副本可以使用完整的源字符串。
标量切片和 children 数组保留维度的文本边界;片段被视为单个节点。在浏览器中更改宽度和内容后检查减少情况。是否发生缩减取决于 DOM 的大小。
classNames/styles 支持 root、actions、action 和 textarea 对象或 props 中的函数。styles - CSS 字符串; ConfigProvider.typography 设置系列的默认值。 语义示例 显示了工作设计。 theme.components.Typography 组件设计令牌(design tokens)设置标题缩进; titleMarginTop 对版式提供的相邻块进行操作,而不是对任何任意标题进行操作。 6.7 文档中的 Shimmer 尚未被继承。
操作按钮具有区域设置可访问的名称。 bind:nativeElement 指向当前元素,但在编辑期间不存在。切换到编辑器后,请勿使用旧节点的链接。
该系列的所有变体都支持 prefixCls。非空值指定完整的本地前缀;空字符串和 undefined 使用带有 -typography 后缀的 ConfigProvider.prefixCls。每个嵌套变体都会选择自己的前缀:本地 Typography.prefixCls 不会自动传递给 TypographyText。前缀涵盖修饰符、ellipsis、操作和单独的编辑器根。 前缀示例 在更新类时保留草稿、选择、焦点和复制成功。主题变量的命名空间和嵌套的 Tooltip 的前缀是独立设置的。
在 Ant Design 6.6.8 标准中,更改前缀时的 copy/编辑操作可以由于记忆而保留以前的类。 Svelte 使用 root 更新它们;这是与标准的这种行为的有意识的区别。
示例状态存储在 Svelte 组件中。
npm install @woodger/antd 版式通过标题、段落、列表、引用和内联代码来格式化文章。
<script lang="ts">
import { Typography, TypographyLink, TypographyParagraph, TypographyTitle } from '@woodger/antd';
</script>
<Typography>
<TypographyTitle level={3}>{("项目设置")}</TypographyTitle>
<TypographyParagraph>
{("安装包并连接样式。一般供应商会指定组件的颜色、尺寸和密度。")}
</TypographyParagraph>
<TypographyTitle level={4}>{("操作流程")}</TypographyTitle>
<ol><li>
{("选择一个组件。")}
</li><li>
{("配置您的设置。")}
</li><li>
{("在浏览器中检查结果。")}
</li></ol>
<blockquote>{("示例状态存储在 Svelte 组件中。")}</blockquote>
<pre><code>npm install @woodger/antd</code></pre>
<TypographyParagraph>{("有关该项目的问题可以在 ")}<TypographyLink
href={("/contacts")}
>{("联系页面")}</TypographyLink>.</TypographyParagraph>
</Typography>
level=1…5 创建真正的 h1…h5。根据文档的结构选择级别。
<script lang="ts">
import { TypographyTitle } from '@woodger/antd';
const levels = [1, 2, 3, 4, 5] as const;
</script>
{#each levels as level (level)}<TypographyTitle
{level}
>{("级别标题 ")}{(level)}</TypographyTitle>{/each}
颜色状态、突出显示、代码、键和本机链接。disabled 指定排版。
<script lang="ts">
import { TypographyLink, TypographyText } from '@woodger/antd';
</script>
<style>
.samples {
display: grid;
justify-items: start;
gap: 12px;
}
</style>
<div class="samples">
<TypographyText>{("纯文本")}</TypographyText>
<TypographyText type="secondary">{("次要文本")}</TypographyText>
<TypographyText type="success">{("操作完成")}</TypographyText>
<TypographyText type="warning">{("需要验证")}</TypographyText>
<TypographyText type="danger">{("操作错误")}</TypographyText>
<TypographyText disabled>{("无法访问的文本")}</TypographyText>
<TypographyText mark>{("标记突出显示")}</TypographyText>
<TypographyText code>npm install @woodger/antd</TypographyText>
<TypographyText keyboard>Enter</TypographyText>
<TypographyText underline>{("下划线")}</TypographyText>
<TypographyText delete>{("偏僻的")}</TypographyText>
<TypographyText strong>{("大胆的")}</TypographyText>
<TypographyText italic>{("斜体")}</TypographyText>
<TypographyLink href={("/contacts")} target="_blank">
{("新选项卡中的联系人")}
</TypographyLink>
</div>
editable.onChange 接受保存的文本。 Enter 保存,Escape 取消,失去焦点保存输入。
<script lang="ts">
import { TypographyParagraph } from '@woodger/antd';
let text = $state(("章节标题"));
</script>
<TypographyParagraph children={text} editable={{
onChange: next => { text = next; },
tooltip: "更改姓名"
}} />
<p><output aria-label={("已保存的名称")}>{text}</output></p>
单击要编辑的文本。编辑由应用程序控制;回调显示阶段,maxLength 和 autoSize 配置编辑器。
<script lang="ts">
import { TypographyParagraph } from '@woodger/antd';
let text = $state(("发行说明"));
let editing = $state(false);
let events = $state<string[]>([]);
function handleStart() {
editing = true;
events = [...events, 'start'];
}
function handleSave(next: string) {
text = next;
editing = false;
events = [...events, 'change'];
}
function handleCancel() {
editing = false;
events = [...events, 'cancel'];
}
</script>
<TypographyParagraph children={text} editable={{
editing, maxLength: 80, autoSize: { minRows: 2, maxRows: 4 }, triggerType: ['text'],
tooltip: "编辑备注", onStart: handleStart, onChange: handleSave,
onCancel: handleCancel, onEnd: () => { events = [...events, 'end']; }
}} />
<p><output aria-label={("编辑活动")}>{(events.join(' → ')
|| ("没有活动"))}</output></p>
<script lang="ts">
import { TypographyParagraph } from '@woodger/antd';
let copies = $state(0);
</script>
<TypographyParagraph
copyable={{ tooltips: ["复制地址", "地址已复制"] }}
>hello@woodger.org</TypographyParagraph>
<TypographyParagraph copyable={{
text: 'npm install @woodger/antd', icon: ['Copy', 'Done'],
tooltips: ["复制命令", "命令已复制"], onCopy: () => { copies += 1; }
}}>{("安装命令")}</TypographyParagraph>
<p><output aria-label={("复制命令")}>{copies}</output></p>
文本函数在单击时被调用,并且可以返回 Promise。显示的签名与复制的行保持分离。
<script lang="ts">
import { TypographyParagraph } from '@woodger/antd';
let release = $state('1.0');
</script>
<style>
label {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
}
</style>
<TypographyParagraph copyable={{ text: async () => `发布 ${release}: @woodger/antd`,
tooltips: ["复制发布详细信息", "已复制信息"]
}}>{("当前发布信息")}</TypographyParagraph>
<label>{("发布号 ")}<input bind:value={release} /></label>
actions.placement 将编辑/copy 放置在文本之前或之后。切换不会改变保存的值。
<script lang="ts">
import { TypographyParagraph } from '@woodger/antd';
let text = $state(("动作文本"));
let atStart = $state(false);
</script>
<style>
label {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 16px;
}
</style>
<label><input
type="checkbox"
bind:checked={atStart}
/>{(" 文本之前的操作")}</label>
<TypographyParagraph children={text} actions={{ placement: atStart ? 'start' : 'end' }}
editable={{ onChange: next => { text = next; }, tooltip: "通过操作更改文本" }}
copyable={{ tooltips: ["通过操作复制文本", "复制文本"] }} />
<script lang="ts">
import { TypographyParagraph, TypographyText } from '@woodger/antd';
const text =
"项目文档包含组件描述、使用示例和 API 参数。 "
+ "首先,选择所需的组件,然后测试其在浅色和深色主题中的行为。 "
+ "每张卡的源代码都可以打开并复制到您的应用程序中。 "
+ "尺寸、颜色和密度的常规设置在页面之间保留。";
</script>
<style>
.paragraph { margin-top: 20px; }
</style>
<TypographyText ellipsis style="
display: block;
width: 100%;
" children={text} />
<div class="paragraph"><TypographyParagraph children={text} ellipsis={{
rows: 2,
expandable: true,
tooltip: text,
symbol: "完整阅读"
}} /></div>
Expanded 和 onExpand 连接到 Svelte 状态。collapsible 模式允许您再次折叠文本;外部按钮重置开口。
<script lang="ts">
import { Button, TypographyParagraph } from '@woodger/antd';
const text =
"项目文档包含组件描述、使用示例和 API 参数。 "
+ "首先,选择所需的组件,然后测试其在浅色和深色主题中的行为。 "
+ "每张卡的源代码都可以打开并复制到您的应用程序中。 "
+ "尺寸、颜色和密度的常规设置在页面之间保留。";
let expanded = $state(false);
</script>
<TypographyParagraph children={text} ellipsis={{
rows: 2, expandable: 'collapsible', expanded,
symbol: open => open ? "坍塌" : "扩张", onExpand: (
_event,
info
) => { expanded = info.expanded; }
}} />
<Button onclick={() => { expanded = false; }}>{("从外面塌陷")}</Button>
<p><output aria-label={("揭示文字")}>{(expanded ? "揭晓" : "倒塌")}</output></p>
行的开头传递给 children,未更改的尾部传递给 suffix 这样文件扩展名仍然可见。
<script lang="ts">
import { TypographyText } from '@woodger/antd';
const filename = 'documentation-components-implementation-examples-release-notes-2026.md';
const tail = filename.slice(-12);
</script>
<TypographyText children={filename.slice(0, -tail.length)} ellipsis={{
suffix: tail,
tooltip: filename
}} style="
display: block;
width: 100%;
" />
后缀仍保留在缩短的文本中。没有服务签名的原始完整行已发送以供复印。
<script lang="ts">
import { TypographyParagraph } from '@woodger/antd';
const text =
"项目文档包含组件描述、使用示例和 API 参数。 "
+ "首先,选择所需的组件,然后测试其在浅色和深色主题中的行为。 "
+ "每张卡的源代码都可以打开并复制到您的应用程序中。 "
+ "尺寸、颜色和密度的常规设置在页面之间保留。";
</script>
<TypographyParagraph children={text} ellipsis={{
rows: 2,
expandable: true,
suffix: " - 管理",
symbol: "下一步"
}}
copyable={{ text, tooltips: ["复制完整段落", "已复制段落"] }} />
| 阶段 | 负责任的 |
|---|---|
| 开发 | 安娜 |
| 文档 | 鲍里斯 |
<script lang="ts">
import { Typography } from '@woodger/antd';
</script>
<style>
.table-scroll {
max-width: 100%;
overflow-x: auto;
}
</style>
<div class="table-scroll">
<Typography>
<table>
<caption>{("发布计划")}</caption>
<thead>
<tr>
<th scope="col">
{("阶段")}
</th>
<th scope="col">
{("负责任的")}
</th>
</tr>
</thead>
<tbody><tr><th
scope="row"
>{("开发")}</th><td>{("安娜")}</td></tr><tr><th
scope="row"
>{("文档")}</th><td>{("鲍里斯")}</td></tr></tbody>
</table>
</Typography>
</div>
ConfigProvider.typography 指定整体布局。本地函数 styles 和 classNames 更改 root/actions/action/textarea,保留原始操作。
<script lang="ts">
import { ConfigProvider, TypographyParagraph } from '@woodger/antd';
let text = $state("版式设计");
</script>
<ConfigProvider typography={{
styles: {
root: `
border-inline-start: 3px solid var(--ant-color-primary);
padding-inline-start: 12px;
`
}
}}>
<TypographyParagraph children={text} classNames={{ action: 'documented-typography-action' }}
styles={({ props }) => ({
root: props.direction === 'rtl' ? 'text-align:end' : '',
actions: 'margin-inline-start:8px',
action: 'color:#722ed1',
textarea: 'border-style:dashed'
})}
editable={{ onChange: next => { text = next; }, tooltip: "编辑语义示例" }}
copyable={{ tooltips: ["复制语义示例", "复制的示例"] }} />
</ConfigProvider>
所有版式变体、缩写和操作都使用本地或共享的 prefixCls。该更改保留了编辑器和复制状态。
<script lang="ts">
import {
Checkbox, ConfigProvider, Typography, TypographyLink, TypographyParagraph,
TypographyText, TypographyTitle
} from '@woodger/antd';
let custom = $state(true);
let local = $state(true);
let rtl = $state(false);
let text = $state(("文件草案"));
let event = $state(("没有变化"));
let copies = $state(0);
const prefix = $derived(custom ? 'suite' : 'ant');
const prefixCls = $derived(local ? 'project-typography' : '');
</script>
<style>
.example {
display: grid;
gap: 20px;
min-width: 0;
}
.controls {
display: flex;
flex-wrap: wrap;
gap: 12px;
}
.scope {
display: grid;
gap: 12px;
min-width: 0;
}
p { margin: 0; }
output { overflow-wrap: anywhere; }
</style>
<div class="example">
<div class="controls">
<Checkbox bind:checked={custom}>{("通用前缀排版套件")}</Checkbox>
<Checkbox bind:checked={local}>{("本地版式前缀")}</Checkbox>
<Checkbox bind:checked={rtl}>{("带前缀的 RTL 版式")}</Checkbox>
</div>
<ConfigProvider prefixCls={prefix} direction={rtl ? 'rtl' : 'ltr'}
theme={{ cssVar: { prefix: 'typography-theme' } }}>
<div class="scope">
<Typography {prefixCls} class="prefix-typography-article">
{("带前缀的文档")}
</Typography>
<TypographyTitle {prefixCls} level={4} style="margin:0"
class="prefix-typography-title">{("文件标题")}</TypographyTitle>
<TypographyText {prefixCls} strong mark code type="secondary"
class="prefix-typography-text">{("格式化文本")}</TypographyText>
<TypographyLink {prefixCls} href={("#typography-prefix-destination")}
class="prefix-typography-link">{("到示例状态")}</TypographyLink>
<TypographyText {prefixCls} ellipsis style="
width: 100%;
max-width: 180px;
"
class="prefix-typography-ellipsis">
{("无论前缀如何,长字符串都会被缩短")}
</TypographyText>
<TypographyParagraph {prefixCls} children={text} style="margin-bottom:0"
class="prefix-typography-editor" editable={{
tooltip: "编辑带有前缀的文本",
onChange: next => { text = next; event = ("已保存"); },
onCancel: () => { event = ("取消"); }
}} copyable={{
text, tooltips: ["复制带有前缀的文本", "已复制带有前缀的文本"],
onCopy: () => { copies += 1; }
}} />
</div>
</ConfigProvider>
<ConfigProvider prefixCls="neighbor">
<TypographyText {prefixCls} type="warning" class="prefix-typography-neighbor">
{("\n 邻近地区\n ")}
</TypographyText>
</ConfigProvider>
<output id="typography-prefix-destination" aria-label={("带前缀的版式状态")}>{("\n 一般的: ")}{prefix}{(";班级: ")}{(prefixCls
|| prefix + '-typography')};
{event}{(";副本: ")}{copies}{(";文本: ")}{text}
</output>
<p>
{("本地前缀分别传递给每个变体。编辑器和操作会随文本一起更新类;工具提示独立选择其前缀。")}
</p>
</div>
评论中的原始示例:设计、链接、编辑、复制和可折叠描述。
<script lang="ts">
import {
Typography,
TypographyLink,
TypographyParagraph,
TypographyText,
TypographyTitle
} from '@woodger/antd';
let text = $state(("该文本可以直接在页面上编辑。"));
const description = "Ant Design for Svelte 结合了类型化组件, "
+ "可用的控件和一般设计设置。 "
+ "长文本可以折叠为两行,然后完全展开, "
+ "保留页面的上下文和其余示例的位置。";
</script>
<style>
.example { max-width: 640px; }
.samples {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 12px;
margin-bottom: 16px;
}
</style>
<div class="example">
<Typography>
<TypographyTitle level={3}>{("文本、标题和链接")}</TypographyTitle>
<div class="samples">
<TypographyText>{("纯文本")}</TypographyText>
<TypographyText type="secondary">{("中学")}</TypographyText>
<TypographyText type="success">{("成功")}</TypographyText>
<TypographyText type="warning">{("警告")}</TypographyText>
<TypographyText type="danger">{("错误")}</TypographyText>
<TypographyText mark>{("选择")}</TypographyText>
<TypographyText code>npm install @woodger/antd</TypographyText>
<TypographyText keyboard>Enter</TypographyText>
<TypographyLink
href={("/ant-design")}
>{("组件库")}</TypographyLink>
</div>
<TypographyParagraph
children={text}
editable={{ onChange: value => { text = value; }, tooltip: "编辑文字" }}
copyable={{ text, tooltips: ["复制文本", "已复制"] }}
/>
<TypographyParagraph
children={description}
ellipsis={{
rows: 2,
expandable: 'collapsible',
symbol: expanded => expanded ? "坍塌" : "更多的"
}}
/>
</Typography>
</div>
11 个 ant.design 实时页面主题映射到可用的 Svelte API。完整的 Props 定义属于包;该表显示了操作的主要参数。
| 主题 | 示例或限制 |
|---|---|
| Basic | 文章、列表、引用和代码。 |
| Title Component | 真正的 h1…h5。 |
| Text and Link Component | 颜色、装饰和本地链接。 |
| Shimmer Text | shimmer 是在 React 6.7.0 中引入的;不存在于已安装的软件包中。 |
| Editable | 此外,还显示受控编辑、回调和 placement 操作。 |
| Copyable | 常规和单独指定的文本;另一个例子返回一个 Promise。 |
| Ellipsis | 单行和多行、工具提示和扩展。 |
| Controlled ellipsis expand/collapse | 受控扩展和外部复位。 |
| Ellipsis from middle | 通过 suffix 保存的文件名尾部。 |
| suffix | 带后缀的段落和全文的复制。 |
| Table | Typography 中本地表格的设计。 |
| CSS prefix | 所有变体的通用和本地前缀;保持草稿、焦点和成功的复制。 |
| 属性 | 描述 | 类型 | 默认 |
|---|---|---|---|
prefixCls | 文本、样式、操作和编辑器的完整本地前缀。空字符串和 undefined 使用提供者前缀。 | string | ConfigProvider.prefixCls + "-typography" |
children | 字符串、数字、数组和 Svelte 片段。对于复制和归约操作,源字符串很重要。 | TypographyContent | — |
editable | 编辑器和回调。应用程序将新行保存在 onChange 中。 | boolean | TypographyEditConfig | false |
copyable | 复制原文或单独指定的文本; text 可以是异步函数。 | boolean | TypographyCopyConfig | false |
ellipsis | Paragraph 和 Title 支持 rows 和展开。Text 不提供 rows、expandable 和 onExpand。link 只接受 boolean。tooltip.alignPoint 将提示定位到指针坐标。 | boolean | TypographyEllipsisConfig | false |
actions | 编辑/copy/expand 面板相对于文本的位置。 | { placement: start | end } | end |
type | 文字颜色。disabled 指定设计;它不会禁用操作处理程序。 | secondary | success | warning | danger | 常规颜色 |
code | 等宽设计。还可以使用标记、键盘、下划线、删除、粗体和斜体;标题中缺少strong。 | boolean | false |
classNames | info.props 中的类 root、actions、action 和 textarea、object 或 function。 | TypographySemantic | — |
styles | 相同插槽的 CSS 行。本地值覆盖 ConfigProvider.typography。 | TypographySemantic | — |
nativeElement | bind:nativeElement 返回当前的 HTML 元素;当去编辑器时它丢失了。 | HTMLElement | — |
版式创建文章,组件更改本机容器。 TypographyTitle 使用 level=1...5,TypographyText - span,TypographyParagraph - 带缩进的 div,TypographyLink - 带 href 的。如果未明确指定 rel,则 target="_blank" 得到 rel="noopener noreferrer"。
text 指定编辑器的源文本;编辑启用托管模式。 onStart、onChange、onCancel 和 onEnd 通过 Enter 传达开始、保存、取消和结束的信息。在受控模式下,所有者独立更改编辑和 children。 maxLength、autoSize、triggerType、icon、tooltip、enterIcon 和 tabIndex 配置编辑器及其启动。
text - 带有 Promise 的字符串或函数;空值使用 children。icon 和工具提示可以指定正常和成功状态。 tooltips=false 隐藏工具提示,tabIndex 控制 Tab 顺序。 format选择 text/plain或者 text/html,复制成功后调用 onCopy。
rows 限制行数,expandable=true 允许您展开、collapsible - 展开和折叠。 Expanded/onExpand 控制状态,defaultExpanded 设置开始。suffix 保留缩写文本,符号更改操作签名,tooltip 显示整行,onEllipsis 报告缩写的事实。
root - 当前容器;行动——actions 面板;动作——每个按钮; textarea - 编辑器字段。 classNames/styles 对象和函数可以在本地使用,也可以通过 ConfigProvider.typography 使用。styles 接受 CSS 字符串。
标题保留 h1...h5,链接 – 原生 a。操作由具有 locale 或工具提示名称的按钮执行。编辑时,焦点转到 textarea:Enter 保存,Shift+Enter 添加一行,Escape 取消,blur 保存。
该系列没有单独的 focus()/blur() 实例。对于原生元素,有 bind:nativeElement;在编辑期间,主要元素被编辑器替换。
每个 Typography 变体都会选择自己的 prefixCls:本地文章前缀不会自动传递给嵌套的 TypographyText。前缀涵盖文本、修饰、ellipsis、动作和编辑器;主题命名空间和工具提示前缀是独立的。更改前缀时,当前模式的 DOM、草稿和复制状态将被保留。
根据 ant.design 和 ComponentTokenMap 检查两个组件令牌。 theme.components.Typography 在适当的排版状态下应用标题缩进。本地样式由 ConfigProvider.typography 和语义 styles 指定,如下所示 登记卡.
| 代币 | 目的 |
|---|---|
titleMarginTop | 标题上边距。 |
titleMarginBottom | 底部标题填充。 |
theme.useToken() 值响应部分设置。
| 代币 | 当前值 |
|---|---|
colorErrorText | #ff4d4f |
colorErrorTextActive | #d9363e |
colorErrorTextHover | #ff7875 |
colorFillAlter | rgba(0,0,0,0.02) |
colorIcon | rgba(0,0,0,0.45) |
colorLink | #1677ff |
colorLinkActive | #0958d9 |
colorLinkHover | #69b1ff |
colorPrimaryBorder | #adc6ff |
colorSplit | rgba(5,5,5,0.06) |
colorSuccess | #52c41a |
colorSuccessText | #52c41a |
colorText | rgba(0,0,0,0.88) |
colorTextDescription | rgba(0,0,0,0.45) |
colorTextDisabled | rgba(0,0,0,0.25) |
colorTextHeading | rgba(0,0,0,0.88) |
colorWarningText | #faad14 |
borderRadiusLG | 8 |
fontFamilyCode | 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace |
fontSize | 14 |
fontSizeHeading1 | 38 |
fontSizeHeading2 | 30 |
fontSizeHeading3 | 24 |
fontSizeHeading4 | 20 |
fontSizeHeading5 | 16 |
fontWeightStrong | 600 |
lineHeight | 1.5714285714285714 |
lineHeightHeading1 | 1.2105263157894737 |
lineHeightHeading2 | 1.2666666666666666 |
lineHeightHeading3 | 1.3333333333333333 |
lineHeightHeading4 | 1.4 |
lineHeightHeading5 | 1.5 |
lineType | solid |
lineWidth | 1 |
lineWidthFocus | 3 |
linkDecoration | none |
linkFocusDecoration | none |
linkHoverDecoration | none |
marginXS | 8 |
marginXXS | 4 |
motionDurationMid | 0.2s |
motionDurationSlow | 0.3s |
padding | 16 |
paddingSM | 12 |
将 editable.onChange 中的字符串放入状态并将其传递给 children。编辑模式和内容分开控制。
内联 TypographyText 需要明确的宽度。对于多行和扩展,请使用 TypographyParagraph 或 TypographyTitle。
将字符串的尾部传递给 suffix 对于 tooltip 和副本,您可以保留完整的原始名称。
对于简单的文档表格,Typography 中的表格就足够了。排序、过滤、行选择和分页需要表格。