This chapter documents the atomic Claude UI components found in the Claude Desktop 1.x front-end build: buttons, the segmented control, status indicators, the confirmation dialog and attachment tiles. It is a translation of the Chinese handbook chapter; every value is copied from it unchanged, and code blocks are reproduced as-is.
Based on an analysis with REA (Reverse Engineer Anything) v6.5.0 of the latest Claude Desktop build (/Applications/Claude.app, @ant/desktop v2.37337.1, ASAR evidence ev_e0bd89cee50a5b7d0dbf9e75cef5dfbca2bcb1699df4d4371449dd08452a8358), this chapter breaks down the production DOM structure, CSS utility-class combinations and native micro-interaction algorithms of Claude's basic interactive controls.
From REA's analysis of shared-frame-BfjMqbuN.js and c6a992d55-sXiDGMFQ.css, Claude does not use a rough 4-step size set. It defines a strict 5-step height scale and aligns it to sub-pixels with the desktop optical scale factor --cds-rem-scale: calc(16 / 17) (≈ 0.941176):
Size
CSS expression (Rem Scale)
Actual desktop pixels
Padding (padding)
Radius (radius)
Type and role
xxs (data-step="1")
calc(1.25rem * scale)
18.82px (about 19px)
px-1.5 py-0
--radius-sm (4px)
11px Caption; very compact inline retry, minor secondary actions
xs
calc(1.5rem * scale)
22.59px (about 23px / 24px)
px-2 py-0.5
--radius-md (6px)
11.5px Footnote; tag removal, code block helper bar
sm
calc(1.75rem * scale)
26.35px (about 26px / 28px)
px-2.5 py-1
--radius-lg (8px)
12.5px; dropdown menu items, action pills inside the composer
md (official default)
calc(2rem * scale)
30.12px (about 32px)
px-3.5 py-1.5
--radius-lg (8px)
13.5px Body; standard actions, form confirmation
lg
calc(2.5rem * scale)
37.65px (about 40px)
px-5 py-2
--radius-xl (12px)
15px Heading; primary global calls to action, main sign-in action
[!NOTE]
Nested control height reduction (--cds-h-control-nested):
When a button is nested inside the Composer or a toolbar container, Claude switches to the nested height variables: nested-xs: calc(1.125rem * scale) (17px) / nested-sm: calc(1.25rem * scale) (18.8px) / nested-default: calc(1.375rem * scale) (20.7px) / nested-lg: calc(1.75rem * scale) (26.35px).
REA's analysis shows that Claude's button is built from two orthogonal layers: an outer interaction reset shell + an inner, separate paint layer (data-cds-part="paint"). This fully decouples the outer focus ring, inner shadow and background gradient, and avoids the slight inner/outer size jitter that traditional CSS buttons show on Hover/Active.
graph LR Outer["Button 外层容器<br>[data-cds='Button'] .cds-btn-squish"] --> Paint["独立绘景图层<br>[data-cds-part='paint'] -z-10"] Outer --> Content["内容排版层<br>Icon + Children + Kbd"] Outer --> Indicator["状态微标插槽<br>[data-cds-part='indicator'] Pulse"]
While analyzing c6a992d55-sXiDGMFQ.css, REA found Claude's striking real spring deformation system. It is not the hard-coded scale(0.98) common in front-end code: it computes a damping factor from the button's runtime height and, on release, triggers a 15-stop CSS linear() spring curve:
[!TIP]
Spring Physics Analysis:
In the --cds-btn-spring curve, the release first shoots out to 1.0915 at the 40% mark (+9.15% physical overshoot), then rebounds slightly to 0.9914 and settles precisely at 1.0004. Combined with a dynamic JS adjustment: Bl(h) = Math.min(1.5, Math.max(0.5, h * (1 / 32))), small buttons scale delicately and large buttons rebound solidly.
When several buttons sit side by side as a combined bar (view switchers, undo/redo groups), the outer wrapper injects joined topology control, which removes the inner corner radii and the doubled middle border automatically:
First item (start): rounded-e-none (square right side)
Middle items (middle): rounded-none (square on both sides)
Last item (end): rounded-s-none (square left side)
Standalone production component: code-examples/CdsButton.tsx (fully synced: 5 sizes, 6 variants, separate paint layer and the .cds-btn-squish 15-stop spring algorithm).
Technical domain: Segmented Control & Pills - .df-pills[data-segmented]
The sliding tabs in Claude Desktop's top navigation and settings use a 999px fully rounded track + purely geometric, equal-width thumb + adaptive collapse with two container-query breakpoints.
When the container is squeezed by a narrow sidebar or window resizing, Claude never wraps awkwardly. It uses @container to shrink the labels of inactive items step by step:
Standalone production component: code-examples/SegmentedControl.tsx (supports strict 1px track positioning, adaptive collapse at two container breakpoints, and a dual mode with Framer Motion springs).
When a modal dialog opens a second-level child dialog (for example clicking "View details" inside a confirmation dialog), Claude uses an attribute selector to blur and dim the parent dialog underneath:
Double-ring Popover shadow (--cds-shadow-popover):
An outer Gaussian blur plus an inner bevel highlight; the outline has no hard 1px black line.
Scroll-timeline driven:
The container includes [scroll-timeline:--cds-dialog-scroll_block] and .scroll-fade-y. When long content scrolls vertically, it automatically triggers the 28px relative-color fade mask extracted in Chapter 1.
REA's full extraction of the production bundle shared-2-Cb74JByF.js corrects the common community guess of a "128px × 96px wide rectangle". The real official classes are:
For long file names, traditional one-sided truncation (truncate / text-overflow: ellipsis) cuts off the extension at the end, giving long_filename_final..., so the user cannot tell the file type. Claude uses a precise bi-directional mid-truncation algorithm:
However long the file name is (for example deep_reinforcement_learning_policy_gradient_v3.tsx), the extension .tsx is always locked in view with shrink-0, and the middle is joined dynamically by before:content-['…'].
The top-left of the tile parses the file extension and turns it into an uppercase sans-serif badge (such as TS, PY, PDF, CSV, SQL), shown in monospace glyphs on a subtle high-contrast pill background so the file type is clear at a glance.
Standalone production component: code-examples/AttachmentCard.tsx (fully synced: 7.5rem square, bi-directional mid-truncation and the floating remove button protocol).