Border
DraftA constrained set of width and color tokens that define element edges, separate content areas, and communicate interactivity.
- Usage
- Tokens
- Code
- Status & changelog
Common alternative names
Stroke, outline, rule, divider, separator
Principles
Borders are structural, not decorative
Borders should communicate meaning — grouping related content, separating distinct regions, or indicating interactivity. Avoid using borders purely for visual embellishment. Every border should serve a clear purpose in the layout.
Use the minimum weight that works
Start with the default (thin) border weight. Only reach for stronger weights when you need to convey emphasis or create a clear visual hierarchy. Heavier borders draw attention, so use them sparingly to preserve their impact.
Pair width and color intentionally
A border's weight and color work together to set its visual prominence. A thin border in a subtle color recedes into the background, while a thick border in a strong color demands attention. Match the combination to the element's importance in the hierarchy.
Anatomy
Arch UI borders are defined by two properties, each controlled by tokens:
--border-width-* tokens. Ranges from 0px (none) to 4px (thick).--color-border-* tokens. Adapts automatically between light and dark themes.Border style is always solid in Arch UI. We do not provide tokens for dashed or dotted borders because they introduce visual noise and have inconsistent rendering across browsers.
Usage
Separating content regions
Use --border-width-default with --color-border-default to create subtle dividers between content areas — for example, between list items, table rows, or sidebar and main content.
Defining container boundaries
Use --border-width-default with --color-border-subtle for card and container outlines. The subtle color keeps the border from competing with the content inside.
Communicating emphasis
Use --border-width-strong with --color-border-strong when a border needs to stand out — for example, an active tab indicator, a selected state, or a section header underline.
Focus indicators
Every interactive element must have a visible focus ring. Use --color-border-focus for focus outlines to ensure accessibility compliance.
Feedback states
Use semantic border color tokens to communicate validation states:
| State | Token | When to use |
|---|---|---|
| Danger | --color-border-danger | Validation errors, destructive action boundaries |
| Success | --color-border-success | Confirmed inputs, success states |
| Warning | --color-border-warning | Caution indicators, partial validation |
border: var(--border-width-default) solid var(--color-border-default);Use border tokens for all border widths and colours. Tokens adapt to themes automatically and keep the system consistent.
border: 1px solid #e5e5e5;Hardcode pixel values or hex colours for borders. Raw values break theming and drift from the design system over time.
border-width: var(--border-width-default);Default to --border-width-default (1px) for most UI borders. Only escalate to strong or thick when the design requires emphasis.
border-width: var(--border-width-thick);Use thick borders (4px) as a default container boundary. Heavy borders create visual clutter and reduce the prominence of intentional emphasis.
Border width tokens
Border width tokens control the thickness of border lines. They are split into two tiers: primitive tokens that define the raw values, and semantic tokens that assign meaning.
Primitive tokens
Primitive tokens hold the actual pixel values. Do not reference these directly in component CSS — use semantic tokens instead.
| Token | Value | Preview |
|---|---|---|
--border-width-none | 0px | |
--border-width-thin | 1px | |
--border-width-medium | 2px | |
--border-width-thick | 4px |
Semantic tokens
Semantic tokens reference primitives and carry intent. Use these in component styles.
| Token | Resolves to | Value | Preview |
|---|---|---|---|
--border-width-default | --border-width-thin | 1px | |
--border-width-strong | --border-width-medium | 2px |
Border color tokens
Border color tokens control the colour of borders. They adapt automatically between light and dark themes.
Semantic border colors
| Token | Light value | Dark value | Purpose |
|---|---|---|---|
--color-border-default | #dddddd | #5e5e5e | Standard container and divider borders |
--color-border-subtle | #e8e8e8 | #4b4b4b | Low-emphasis borders that recede visually |
--color-border-strong | #a6a6a6 | #868686 | High-emphasis borders for active or selected states |
--color-border-focus | #068bee | #6daafb | Focus ring for interactive elements (a11y required) |
--color-border-danger | #f83446 | #fc7f79 | Error and destructive action borders |
--color-border-success | #009a51 | #06c167 | Success and confirmation borders |
--color-border-warning | #b97502 | #d79900 | Warning and caution borders |
--color-border-disabled | #dddddd | #5e5e5e | Borders on disabled elements |
Feedback border colors
These tokens are used for feedback container backgrounds (alerts, banners) where the border is softer than the semantic border colour above.
| Token | Light value | Dark value |
|---|---|---|
--color-feedback-danger-border | #ffd2cd | #950f22 |
--color-feedback-success-border | #b1eac2 | #166c3b |
--color-feedback-warning-border | #ffd688 | #6b4100 |
--color-feedback-info-border | #cddeff | #175bcc |
Token tier diagram
The border width system follows the same two-tier architecture as all Arch UI tokens:
border.width.thin → 1pxborder.width.defaultborder.width.medium → 2pxborder.width.strongSeparating content regions
.list-item {
border-bottom: var(--border-width-default) solid var(--color-border-default);
}
Defining container boundaries
.card {
border: var(--border-width-default) solid var(--color-border-subtle);
}
Communicating emphasis
.tab--active {
border-bottom: var(--border-width-strong) solid var(--color-border-strong);
}
Focus indicators
.button:focus-visible {
outline: var(--border-width-strong) solid var(--color-border-focus);
outline-offset: 2px;
}
Feedback states
.input--error {
border: var(--border-width-default) solid var(--color-border-danger);
}
Status & changelog coming soon.