Skip to content

Design Principles

Ant Design’s ten principles, translated into concrete rules for ThemeKit and audited against the current library. Use this as the contributor checklist when adding or reviewing a component.

#PrincipleIn our system
1Proximity — related things group togetherSingle 8-pt spacing scale (SpacingKey xs 4 … 4xl 64). Group with sp-sm/md, separate sections with sp-lg/base. Never ad-hoc paddings.
2AlignmentShared scale + Grid/VStack(alignment:); text uses one leading edge. Icons sized via IconSize, not magic numbers.
3ContrastTextStyle ramp (Display→Overline) for hierarchy; color contrast from the token system (text-primary/secondary/tertiary), now WCAG-checked in dark too.
4RepetitionOne token source (Theme) drives every component; RadiusKey/SpacingKey/TextStyle reused everywhere — no per-component constants (ADR-0001).
5Directness — act where you areInline editing (QuantityStepper, Slider, Chip), inline field errorText, swipe/tap on the element itself rather than a separate panel.
6Stay on the page — don’t jump awaySkeleton, Spinner, ProgressBar, RadialProgress keep layout stable while loading; BottomSheet/Drawer/Tooltip/feedback.toast keep context instead of full-screen navigation.
7Lightweight — progressive disclosureAccordion, Tooltip, Drawer, Popover-style surfaces reveal detail on demand; defaults are minimal.
8Invitation — hint what’s possibleEmptyState / ResultView with a clear CTA, Tooltip, placeholder text, Badge/Indicator cues.
9TransitionMotion tokens (instant/fast/base/slow) standardize animation; toasts slide+fade, dialogs fade, theme/dark switches animate.
10React immediatelyPressFeedbackStyle + FillButtonStyle give every button a press/active state (Ant’s hover/active analog); toggles/steppers reflect state instantly.
PrincipleStatusNotes / next
Repetition / tokens✅ Strong128 semantic tokens + 50–900 ladders; zero hardcoded colors in components.
Contrast (incl. dark)✅ GoodReal dark theme derived from the ladders; soft accent surfaces + text verified readable on sim.
Stay on the page✅ GoodSkeleton/Spinner/Progress + toast/sheet/drawer cover loading and feedback without leaving context.
React immediately⚠️ Buttons donePress feedback covers ThemeButton + preset buttons. Next: extend a press style to other tappable surfaces (ListRow, Chip, Card-as-button, MenuCard) so taps feel equally responsive.
Transition⚠️ PartialMotion exists and is used by toggles/toasts/dialogs. Next: audit list/detail navigation pushes and accordion expand for consistent Motion.base.
Invitation✅ GoodEmptyState + new ResultView templates give every dead-end a CTA.
Directness✅ GoodInline steppers/sliders/chips; field-level errors.
Proximity / Alignment✅ GoodSingle spacing scale; no ad-hoc paddings found in spot checks.
Lightweight✅ GoodAccordion/Drawer/Tooltip provide progressive disclosure.
  • Colors/spacing/radius/type come only from Theme tokens (Repetition).
  • Tappable? It has a press/active state (React immediately).
  • Animates with a Motion token, not an ad-hoc duration (Transition).
  • Loading/empty/error states use Skeleton / EmptyState / ResultView (Stay on page, Invitation).
  • Readable in both light and dark (Contrast) — check on device.
  • Errors shown inline at the field, not as a toast (Directness; see Feedback Patterns).