Skip to main content Skip to docs navigation

Border Width Tokens

Comprehensive guide to border width tokens defining consistent border thickness for UI elements throughout the design system.

This documentation is a work in progress. Some information may be incomplete, outdated, or differ from the current product behavior.

Overview

Border width tokens define consistent border thickness values for UI elements throughout the design system. They establish visual weight, create boundaries, and emphasize interactive states while maintaining harmony across all components.

Architecture

Border width tokens are organized into a two-layer system where contextual width values are defined in the App group and then applied to specific components.

How it works:

The system provides semantic width scales:

  1. Contextual border widths (borderWidth.context.*) define semantic thickness values
  2. Component border widths (borderWidth.[component].*) assign specific widths to UI elements

Benefits:

  • Consistent border weight across components
  • Semantic naming clarifies thickness intent
  • Easy to adjust border emphasis globally
  • Clear visual hierarchy through standardized widths

Border width is closely related to visual weight. Thicker borders create more emphasis but can overwhelm small elements. The default medium width (1px) provides sufficient definition for most use cases.

Organization

Border width tokens are organized into two categories:

Contextual Border Width: Semantic width scales from none through 2xlarge.

Component Border Width: Specific border thickness for individual UI components.

This organization ensures both flexibility and consistency.

Contextual Border Width

Contextual border width tokens provide semantic thickness values for flexible application.

Token NameValueVisual WeightPurpose
borderWidth.context.none0NoneNo border
borderWidth.context.zero0NoneNo border (alias)
borderWidth.context.thin0.5pxVery subtleDelicate borders, subtle divisions
borderWidth.context.small0.5pxSubtleLight borders
borderWidth.context.medium1pxStandardDefault border weight
borderWidth.context.large1.5pxEmphasizedProminent borders
borderWidth.context.xlarge2pxStrongStrong emphasis, focus states
borderWidth.context.2xlarge4pxMaximumMaximum emphasis, indicators

Usage by Context

Decorative borders: Use thin or small (0.5px) for subtle visual separation

Standard borders: Use medium (1px) for default component borders

Interactive states: Use large or xlarge (1.5-2px) for focus and active states

Indicators: Use 2xlarge (4px) for strong visual indicators

Component Border Width

Component-specific border width tokens assign thickness to individual UI elements.

Buttons & Interactive Elements

Token NameReferencesApplied To
borderWidth.button.mainborderWidth.context.mediumButton borders
borderWidth.chip.mainborderWidth.context.mediumChip borders
borderWidth.badge.mainborderWidth.context.mediumBadge borders

Form Inputs

Token NameReferencesApplied To
borderWidth.form-input.regularborderWidth.context.mediumDefault input borders
borderWidth.form-input.inactiveborderWidth.context.mediumInactive input state
borderWidth.form-input.activeborderWidth.context.xlargeActive/focus input state
borderWidth.form-input.floatingborderWidth.context.xlargeFloating label inputs

Cards & Containers

Token NameReferencesApplied To
borderWidth.card.mainborderWidth.context.mediumCard containers
borderWidth.modal.mainborderWidth.context.mediumModal dialogs
borderWidth.section.mainborderWidth.context.zeroSection containers (typically no border)
borderWidth.alert.mainborderWidth.context.mediumAlert banners
borderWidth.notification.mainborderWidth.context.mediumNotifications
Token NameReferencesApplied To
borderWidth.dropdown.mainborderWidth.context.mediumDropdown containers
borderWidth.date-picker.mainborderWidth.context.mediumDate picker container

Tables & Lists

Token NameReferencesApplied To
borderWidth.table.mainborderWidth.context.mediumTable borders
borderWidth.accordion.mainborderWidth.context.mediumAccordion borders

Tabs & Navigation

Token NameReferencesApplied To
borderWidth.tab.mainborderWidth.context.mediumTab borders
borderWidth.tooltip.mainborderWidth.context.mediumTooltip borders

Indicators & Assets

Token NameReferencesApplied To
borderWidth.asset.indicator4pxStatus indicators (strong)
borderWidth.asset.separator1pxSeparator lines

Interactive State Patterns

Border width often changes based on interaction state to provide visual feedback.

Standard State Pattern

StateBorder WidthPurpose
Idlemedium (1px)Default appearance
Hovermedium (1px)No change for most components
Focusxlarge (2px)Clear focus indicator
Activexlarge (2px)Pressed/active state
Disabledmedium (1px) or noneReduced visual weight
Errormedium (1px) or xlarge (2px)Error indication

Form Input Pattern

Inputs typically increase border width on focus:

{
  "borderWidth.form-input.inactive": "1px",  // Idle state
  "borderWidth.form-input.active": "2px"     // Focus state
}

This creates clear visual feedback without relying solely on color.

Usage Guidelines

Choosing the Right Token

For components: Use component-specific tokens (borderWidth.button.*, borderWidth.form-input.*)

For custom elements: Use contextual tokens (borderWidth.context.medium)

For no border: Use borderWidth.context.none or borderWidth.context.zero

For emphasis: Use borderWidth.context.xlarge or borderWidth.context.2xlarge

Design Principles

Consistency: Use the same border width for similar component types

Visual Weight: Thicker borders create more visual emphasis

State Indication: Increase border width for focus/active states

Proportion: Ensure border width is proportional to element size

Accessibility

Focus Indicators: Use minimum 2px border width for focus states to meet WCAG requirements

Contrast: Ensure borders have sufficient contrast against backgrounds

State Communication: Don't rely solely on border width to convey state—combine with color changes

Touch Targets: Ensure borders don't reduce effective touch target size

Best Practices

Do:

  • Use component tokens for specific UI elements
  • Increase border width for focus/active states
  • Use medium (1px) as the default for most borders
  • Test border rendering on different screen densities
  • Combine border width with color for state indication

Don't:

  • Use arbitrary border widths—always reference tokens
  • Use borders thicker than 4px except for special indicators
  • Rely only on border width for critical state communication
  • Forget that thick borders add to element dimensions
  • Use sub-pixel borders (< 0.5px) which may not render consistently

Rendering Considerations

Sub-pixel rendering: 0.5px borders may render differently across browsers and devices

High-DPI displays: 1px borders appear thinner on retina screens

Border box sizing: Remember borders add to element dimensions unless using border-box

Mobile devices: Test border rendering on actual devices, not just emulators

Common Patterns

Standard borders: Use borderWidth.context.medium (1px)

Focus rings: Use borderWidth.context.xlarge (2px) for accessibility

Decorative divisions: Use borderWidth.context.thin (0.5px)

Status indicators: Use borderWidth.context.2xlarge (4px) for strong signals

No border: Use borderWidth.context.none explicitly rather than omitting border