Borders define the edge of a surface and separate content within it. A border is three decisions: width, style, and color. Use the hairline token for width, solid for style, and a semantic token for color.
borderWidth (or a side, e.g. borderBottomWidth).borderStyle and color with borderColor.borderWidth="hairline", borderStyle="solid", borderColor="base.border".hairline is the default border width — and it's density-adaptive:
1px on standard displays, so borders stay visible.0.5px on high-DPI / retina displays (≥2x), so borders look crisp and refined.It's a borderWidth token backed by the --chakra-border-hairline CSS variable, so a single token gives the right weight on every screen. Compose it with a style and color rather than using it alone.
When to use
When not to use
1px / 2px.outline shadow (see Shadows), never a thicker border.Avoid
0.5px or 1px for standard borders — use hairline so density is handled for you.0.75px or 1.5px — stick to hairline, or a fixed 1px / 2px for emphasis.hairline alone; always pair it with borderStyle and borderColor.In theme component configs, import the $borderHairline CSS variable and compose it into the border shorthand:
Border color is always a semantic token, never a raw hex or palette step. base.border is the default; reach for an intent color only when the border itself communicates status.
base.border — the outer edge of a surface (input, card, badge, menu).base.divider — separators inside a surface (table rows, list items, sections). It's lighter than base.border so internal structure recedes.primary, danger, warning, success, upsell) — only when the border carries meaning, e.g. an invalid field or a selected option.Use base.border for the edge of a surface and base.divider for separators within it. The divider is one step lighter so the container reads as the dominant shape.
solid is the default for every border.dashed is reserved for pending, placeholder, or not-yet-committed states (e.g. a pending badge). Don't use it for decoration.Borders and shadows do different jobs. A border defines an edge; a shadow lifts a surface off the canvas.
hairline border for definition on a flat surface that sits on the page.hairline border with the buttonShadowLight shadow.borderWidth="hairline" + borderStyle="solid" + borderColor="base.border".base.divider for separators inside a surface.danger.border on an invalid field).0.5px or 1px for standard borders — use hairline.outline shadow.gray.300, hex) when a semantic token exists.