Open Claude UI
中文
AI Chat Interface Components

Claude UI Atoms: Buttons, Toggles & Dialogs

Claude-style React UI atoms: 7 button variants, 5 sizes, segmented control, status lights, dialogs, attachment tiles, container-query toolbar. 8 live demos.

中文版Last updated:

Atomic components are the lowest-level, most reused controls in the Claude desktop interface: buttons, segmented controls, status lights, confirmation dialogs and attachment tiles. Their heights, radii and press feedback all come from one set of tokens, so viewing them together is the easiest way to check them against the spec. The 8 demos on this page correspond to Chapter 2 of the v1 handbook, and 2.0 changes are noted in each section. This page is a translation of the Chinese demo page.

Key values

ItemValueSource
Button height stepsXXS 20 · XS 24 · SM 28 · MD 32 · LG 40pxv1/02 §2.1.1
Button variantsprimary / secondary / ghost / danger / brand / onContent / outlinev1/02 §2.1.2
Status light diameter6pxv1/02 §2.3
Thinking wave cycle1.9sv1/02 §2.3
Dialog widthssm 400 · md 520 · lg 720pxv1/02 §2.4
Attachment tile7.5rem squarev1/02 §2.5

Button variants

Buttons come in 7 variants that differ only in fill and border; sizes and the press rebound share one set of rules.

7 个变体:primary / secondary / ghost / danger / brand / onContent / outline。按下有 .cds-btn-squish 回弹。出处:v1/02 §2.1.2 · code-examples/CdsButton.tsx

Button sizes and loading state

5 heights from 20px to 40px. While loading, the button keeps its width and only swaps the label for a spinner, so the layout doesn't jump.

高度阶梯 XXS 20 · XS 24 · SM 28 · MD 32 · LG 40px;icon 32×32。加载态保留宽度、隐藏文字。出处:v1/02 §2.1.1 · code-examples/CdsButton.tsx

Joined buttons

When several buttons are joined into a group, the radius is removed on the adjacent sides and they share a 1px divider in between.

组合按钮:相邻按钮去掉内侧圆角,中间 1px 分隔线共用边框。出处:v1/02 §2.1.4

Segmented control

The segmented control shows the current item with a sliding selection block, and multiple instances don't interfere with each other.

滑块 left = 1px + index × (100% − 2px) / total,120ms 吸附。容器 ≤180px(2 项)/ ≤254px(3 项)时文字收起只留图标(按代码:所有项都收起;文档写的是只收未选中项)。拖动虚线框右下角试试。当前:Cowork出处:v1/02 §2.2 · code-examples/SegmentedControl.tsx

Status lights and skeletons

Status lights, breathing lights, the three thinking dots and the skeleton sweep are the visual language for every "in progress" state in the interface.

ready
running
error
clay
breathe
pulse
Thinking...
thinking
6px 状态灯;陶土呼吸灯;运行脉冲;思考三点波浪 1.9s;骨架屏 105° 斜向扫光。出处:v1/02 §2.3 · v2/03 §3.5 · code-examples/StatusIndicators.tsx

Confirmation dialogs

Confirmation dialogs use one of 3 widths, and the confirm button for destructive actions uses the danger variant.

弹窗宽度阶梯 sm 400 · md 520 · lg 720px;ease-pop 入场;遮罩点击 / Esc 关闭;危险操作用 danger 按钮。出处:v1/02 §2.4 · code-examples/ConfirmationDialog.tsx

Attachment tiles and pills

Attachments are shown as square tiles; long file names are truncated in the middle so the extension stays visible.

PDF
quarterly….pdf

2.4 MB

TSX
App.tsx

12 KB

MD
notes.md

3 KB

ZIP
design-as….zip

62%

PDFquarterly-finan….pdf2.4 MB
TSXApp.tsx12 KB
磁贴 7.5rem 正方形、同心圆角;右上角浮动移除按钮;长文件名中间截断保留扩展名;大写类型徽标。点 × 可移除。出处:v1/02 §2.5 · code-examples/AttachmentCard.tsx

Container-query toolbar

The toolbar shrinks based on its own container width (@container), not the window width.

Claude 3.7 SonnetThinking
按容器宽度(@container)而不是窗口宽度压缩间距。拖动右下角改变容器宽度。出处:v1/06 §6.5 · v1/02 §2.2.2 · code-examples/ContainerResponsiveBar.tsx

How do I use these components in a project?

Copy the matching file from code-examples/ and import cds-theme.css. For example:

import { CdsButton } from './CdsButton';

<CdsButton variant="primary" size="md">发送</CdsButton>

Note: the labels inside the demo components are still in Chinese (they come straight from the repository's components); the behavior and specs are the same.

Sources

The specs on this page come from Chapter 2 of the v1 handbook, the component code comes from the repository's code-examples/, and browser behavior follows the MDN documentation.

On this page