Borders
Borders group token types: Border, Border Width, Border Radius, Stroke Style — stroke contracts, keys, and examples.
The Borders group covers stroke thickness, corner radius, and dash/cap/join styling.
Border (composite)
border is a full stroke contract.
Export: apply-only (applied directly, not exported as Variable/Style).
Border object keys
| Key | Type | Meaning |
|---|---|---|
color | string | stroke color (literal or alias) |
width | number/string | stroke width (literal or alias) |
style | string | solid, dashed, dotted, none, hidden |
strokeAlign / position / borderAlign | string | inside, center, outside |
strokeJoin / join | string | miter, bevel, round |
endCap / endPoint / strokeCap | string | butt/none, round, square |
dashCap | string | cap for dashed/dotted pattern |
dash | number/string | explicit dash length |
gap | number/string | explicit dash gap |
strokeStyle | string | alias to a strokeStyle token (or string style) |
Basic example
JSON
{
"border": {
"default": {
"$type": "border",
"$value": {
"color": "{color.neutral.300}",
"width": "{borderWidth.sm}",
"style": "solid",
"strokeAlign": "inside"
}
}
}
}
Dashed example with explicit dash/gap
JSON
{
"border": {
"focus": {
"$type": "border",
"$value": {
"color": "#FF6600",
"width": "2px",
"style": "dashed",
"dash": 6,
"gap": 4,
"dashCap": "round",
"strokeJoin": "round"
}
}
}
}
If style is none or hidden, strokes are cleared.
Border Width
borderWidth is a simple numeric stroke-width token.
Export: Variable (FLOAT) with scope STROKE_FLOAT.
JSON
{
"borderWidth": {
"$type": "borderWidth",
"none": { "$value": "0px" },
"sm": { "$value": "1px" },
"md": { "$value": "2px" },
"lg": { "$value": "4px" }
}
}
Border Radius
borderRadius is a simple corner-radius token.
Export: Variable (FLOAT) with scope CORNER_RADIUS.
JSON
{
"borderRadius": {
"$type": "borderRadius",
"none": { "$value": "0px" },
"sm": { "$value": "4px" },
"md": { "$value": "8px" },
"lg": { "$value": "12px" },
"full": { "$value": "9999px" }
}
}
Stroke Style
strokeStyle controls stroke pattern/caps/joins.
Export: apply-only (no standalone Figma Variable/Style).
Accepted forms
- String / alias:
JSON
{
"strokeStyle": {
"$type": "strokeStyle",
"solid": { "$value": "solid" },
"dashed": { "$value": "dashed" },
"dotted": { "$value": "dotted" }
}
}
- Object:
JSON
{
"strokeStyle": {
"dash-compact": {
"$type": "strokeStyle",
"$value": {
"style": "dashed",
"width": "2px",
"dash": 6,
"gap": 4,
"dashCap": "round",
"endCap": "round",
"strokeJoin": "round"
}
}
}
}
- Reference to another stroke style token from a border object:
JSON
{
"border": {
"card": {
"$type": "border",
"$value": {
"color": "{color.neutral.400}",
"width": "{borderWidth.sm}",
"strokeStyle": "{strokeStyle.dash-compact}"
}
}
}
}
Full example
JSON
{
"borderWidth": {
"$type": "borderWidth",
"sm": { "$value": "1px" },
"md": { "$value": "2px" }
},
"borderRadius": {
"$type": "borderRadius",
"sm": { "$value": "4px" },
"md": { "$value": "8px" },
"full": { "$value": "9999px" }
},
"strokeStyle": {
"$type": "strokeStyle",
"focus-dash": {
"$value": {
"style": "dashed",
"dash": 6,
"gap": 4,
"dashCap": "round"
}
}
},
"border": {
"default": {
"$type": "border",
"$value": {
"color": "{color.neutral.300}",
"width": "{borderWidth.sm}",
"style": "solid"
}
},
"focus": {
"$type": "border",
"$value": {
"color": "#FF6600",
"width": "{borderWidth.md}",
"strokeStyle": "{strokeStyle.focus-dash}",
"strokeAlign": "outside"
}
}
}
}
Related pages
- Overview: Tokens overview
- Dimension: Dimension, Number, Sizing, Spacing
- Effects: Shadow, Blur, Glass, Effects