Skip to main content

Overview

Use border-width utilities to control how subtle or emphatic a border feels. Bundled widths use CSS variables such as var(--border-1) so the scale stays tokenized; for context on variables in this stack, see Variables.

Basic Example

Use border-{size} to set the same width on all four sides.

Individual Sides

Use border-t-*, border-r-*, border-b-*, and border-l-* when only one edge needs emphasis.

Horizontal and Vertical Sides

Use border-x-* and border-y-* to apply the same width to a pair of edges.

Best Practices

  • Use border-1 and border-2 for most UI surfaces.
  • Use side-specific widths for tabs, dividers, and timeline markers where only one edge should stand out.
  • Use border-x-* and border-y-* for split layouts and framed media without over-specifying each side.
  • Use border-4 and above sparingly for accents, highlights, and decorative frames.
  • Pair width utilities with explicit style and color helpers such as .border-solid and .border-gray.
  • Keep border widths consistent across similar components.