Skip to content

DOL Design System - Radius

activeUpdated

Scope: Radius tokens → rule dùng thật, để designer/AI chọn radius theo kích thước element. For philosophy: see DIRECTION.md §8 Radius philosophy. For code (Tailwind classes): see ../ui-style-guide/CORE.md §5 Radius.

Tài liệu này chuyển radius tokens thành rule dùng thật - chọn radius theo element size thay vì chỉ nhớ tên token.

Triết lý soft-large + anti-patterns → DIRECTION.md.

  • Ưu tiên token semantic: control/*, surface/*, overlay/*, pill-shape
  • Không pick trực tiếp Base Radius nếu không đang chỉnh scale hệ thống
  • Control dùng family control/*
  • Card / content container dùng family surface/*
  • Modal / dropdown / popover / sheet dùng family overlay/*

Default mapping khuyến nghị:

Element heightRecommended radiusTokenNotes
20-244-8pxcontrol/sm hoặc control/mdTiny control chỉ bo nhẹ
28-328-10pxcontrol/md hoặc control/md-subCompact control
3612pxcontrol/lgMedium control
4014pxcontrol/lg-subStandard button / field compact
4816pxcontrol/xlPrimary button default
5620pxcontrol/2xlLarge button
6424pxcontrol/3xlHero button / large prominent control
80+32px+control/4xl hoặc control/5xlLarge content-like control block

Design intent:

  • height 40 → radius 14
  • height 48 → radius 16
  • element càng lớn thì radius cũng tăng lên theo 20, 24, 32, 40
Control typeRecommended token
Standard input / standard buttoncontrol/lg-sub hoặc control/xl tùy height
Primary button 48pxcontrol/xl
Large CTA 56pxcontrol/2xl
Hero CTA 64pxcontrol/3xl
Checkbox / tiny utilitycontrol/sm
Dense compact buttoncontrol/md hoặc control/md-sub

Rule of thumb:

  • Nếu control là core action và có chiều cao 48px, mặc định dùng control/xl
  • Nếu cùng một component family có nhiều sizes, radius phải tăng cùng height, không giữ nguyên một radius cho mọi size
Surface typeRecommended tokenNotes
Standard cardsurface/mdDefault an toàn
Feature card / elevated cardsurface/lg hoặc surface/xlKhi block lớn hơn và muốn cảm giác mềm hơn
Large section blocksurface/2xlDùng cho container lớn
Showcase / hero surfacesurface/3xlChỉ dùng khi block thực sự lớn
Overlay typeRecommended tokenNotes
Tooltip / small popupoverlay/sm
Dropdown / popoveroverlay/md
Modal defaultoverlay/lg
Large modal / bottom sheet prominentoverlay/xl hoặc overlay/2xl

Dùng pill-shape cho:

  • chip
  • capsule tag
  • status pill
  • segmented item dạng capsule thật sự

Không dùng pill-shape cho:

  • card
  • modal
  • input thường
  • mọi button chỉ vì muốn “bo nhiều”

Nếu AI thiếu context chi tiết, hãy dùng:

  1. Button/Input 40px: control/lg-sub
  2. Button/Input 48px: control/xl
  3. Button/Input 56px: control/2xl
  4. Card mặc định: surface/md
  5. Modal mặc định: overlay/lg

Do:

  • Giữ radius tăng theo height.
  • Dùng soft-large radius như visual default.
  • Chọn family đúng theo loại element: control, surface, overlay.

Dont:

  • Không dùng một radius cố định cho mọi button size.
  • Không fallback về corner nhỏ kiểu 6-8px cho button 48px nếu không có constraint mật độ thật.
  • Không dùng pill cho mọi thứ.
  • Hub: README.md
  • Direction & philosophy: DIRECTION.md
  • Related topic files: spacing.md
  • Code reference: ../ui-style-guide/CORE.md §5 Radius (controls, surfaces, overlays với Tailwind classes)
  • Cross-repo: Playground - docs/PLAYGROUND_UI_REUSE_GUIDE.md (component reuse patterns)