Skip to Content

Radius

Radius tokens define consistent corner curvature for buttons, cards, input fields, and other components.

Overview

Pine provides 11 foundation radius tokens from none to pill. These map to semantic tokens (small, medium, large, xlarge, full) and to component tokens (button.radius, badge.radius, input.radius, card.radius). Each theme (basic, game, crayon) maps them to different foundation values, so the same component can look sharp in the game theme and rounded in the crayon theme.

full (100%) turns a square element into a circle, such as a status dot. pill (9999px) rounds the short sides of a wide element into half-circles, so use it for pill-shaped buttons and badges.

Foundation Radius Tokens

TokenPreviewValue
none
0px
xxs
2px
xs
4px
sm
6px
md
8px
lg
12px
xl
16px
xxl
24px
xxxl
32px
full
100%
pill
9999px

Theme Adapters

Semantic tokens (small, medium, large, xlarge) map to foundation tokens per theme:

Themesmallmediumlargexlargefull
basicsm (6px)xl (16px)xxl (24px)xxxl (32px)100%
gamenone (0px)none (0px)none (0px)none (0px)100%
crayonlg (12px)xxl (24px)xxxl (32px)xxxl (32px)100%
  • basic: Rounded, pill-friendly style
  • game: Sharp corners (0px) for pixel-art feel
  • crayon: Very rounded for a soft, hand-drawn look

Component Mapping

Components with a rounded prop (small, medium, large) read component radius tokens instead of the semantic ones. A radius at or above half an element’s height already renders as a pill, so each component gets values sized for its own height. That keeps the three steps visibly distinct at every size, and large is always a full pill.

TokenUsed bybasiccrayon
button.radiusButtonsm (6px) / xl (16px) / pillmd (8px) / xl (16px) / pill
badge.radiusBadgexs (4px) / md (8px) / pillxs (4px) / md (8px) / pill
input.radiusTextField, Dropdownxs (4px) / lg (12px) / pillxs (4px) / lg (12px) / pill

The game theme sets every component radius to none (0px). Its pixel frame is drawn with box-shadow, which border-radius can’t round, so rounded steps the frame’s corners instead: small is square, medium cuts a one-step notch, and large cuts a two-step corner. See Shadow for the pixelColor token behind the frame.

The ThemeProvider’s design prop selects the theme.

Guidelines

  • Consistency: Use the same radius token for components at the same hierarchy level (e.g. buttons, cards).
  • Theme alignment: Let the theme drive radius—avoid overriding with custom values unless necessary.
  • Visual hierarchy: Use larger radius for containers (cards, modals) and smaller for controls (buttons, inputs) within the same theme.
  • Accessibility: Avoid extreme radius on small touch targets; it can reduce the perceived clickable area.
Last updated on