--- title: Borders path: utilities/borders status: Stable status_issue: 'https://github.com/github/design-systems/issues/72' source: 'https://github.com/primer/css/tree/main/src/utilities/borders.scss' bundle: utilities --- Utilities for borders, and border radius. ## Default border The default border utility applies a solid, 1px border, with a default gray color. ```html live
.border
``` Borders can be applied to a specific edge or to the X and Y axes individually: ```html live
.border-left
.border-top
.border-bottom
.border-right
.border-x
.border-y
``` Remove borders from all sides or a single side with `.border-0`, `.border-top-0`, `.border-right-0`, `.border-bottom-0`, `.border-left-0`. ```html live
.border-top-0
``` ## Border style Use `border-dashed` to give an element a dashed border. ```html live
.border-dashed
``` ## Rounded corners Use the following utilities to add or remove rounded corners: `rounded-0` removes rounded corners, `rounded-1` applies a border radius of 4px, `rounded-2` applies a border radius of 6px. `.circle` applies a border radius of 50%, which turns square elements into perfect circles. ```html live
.rounded-0
.rounded-1
.rounded-2
.rounded-3
.circle
``` You can also add rounded corners to each edge (top, right, bottom, left) with the following utilities: ```html live
.rounded-top-2
.rounded-right-2
.rounded-bottom-2
.rounded-left-2
``` ## Responsive borders You can adjust border widths on all sides or each side individually with responsive border utilities: - `border-(sm|md|lg|xl)` adds borders on all sides at and above the breakpoint. The `border-(sm|md|lg|xl)` shorthand is also supported. - `border-(sm|md|lg|xl)-0` removes borders from all sides at and above the breakpoint. - `border-(sm|md|lg|xl)-(top|right|bottom|left)` adds a border on the given side at and above the breakpoint. - `border-(sm|md|lg|xl)-(top|right|bottom|left)-0` the border from the given side at and above the breakpoint. ```html live
.border-top .border-sm-right .border-md-bottom .border-md-top-0
``` ## Border colors Border colors are documented on the [colors utilities page](../utilities/colors#border-colors).