| Class | Styles |
|---|---|
| .rounded-0 | --bs-rounded-size: 0; border-radius: var(--bs-rounded-size); |
| .rounded-1 | --bs-rounded-size: 0.125rem; border-radius: var(--bs-rounded-size); |
| .rounded-2 | --bs-rounded-size: 0.1875rem; border-radius: var(--bs-rounded-size); |
| .rounded-3 | --bs-rounded-size: 0.25rem; border-radius: var(--bs-rounded-size); |
| .rounded-4 | --bs-rounded-size: 0.375rem; border-radius: var(--bs-rounded-size); |
| .rounded-5 | --bs-rounded-size: 0.5rem; border-radius: var(--bs-rounded-size); |
| .rounded-6 | --bs-rounded-size: 0.625rem; border-radius: var(--bs-rounded-size); |
| .rounded-7 | --bs-rounded-size: 0.75rem; border-radius: var(--bs-rounded-size); |
| .rounded-8 | --bs-rounded-size: 1rem; border-radius: var(--bs-rounded-size); |
| .rounded-9 | --bs-rounded-size: 1.5rem; border-radius: var(--bs-rounded-size); |
| .rounded | --bs-rounded-size: 0.5rem; border-radius: var(--bs-rounded-size); |
| .rounded-circle | --bs-rounded-size: 50%; border-radius: var(--bs-rounded-size); |
| .rounded-pill | --bs-rounded-size: var(--bs-radius-pill); border-radius: var(--bs-rounded-size); |
| .rounded-top-0 | border-start-start-radius: 0; border-start-end-radius: 0; |
| .rounded-top-1 | border-start-start-radius: 0.125rem; border-start-end-radius: 0.125rem; |
| .rounded-top-2 | border-start-start-radius: 0.1875rem; border-start-end-radius: 0.1875rem; |
| .rounded-top-3 | border-start-start-radius: 0.25rem; border-start-end-radius: 0.25rem; |
| .rounded-top-4 | border-start-start-radius: 0.375rem; border-start-end-radius: 0.375rem; |
| .rounded-top-5 | border-start-start-radius: 0.5rem; border-start-end-radius: 0.5rem; |
| .rounded-top-6 | border-start-start-radius: 0.625rem; border-start-end-radius: 0.625rem; |
| .rounded-top-7 | border-start-start-radius: 0.75rem; border-start-end-radius: 0.75rem; |
| .rounded-top-8 | border-start-start-radius: 1rem; border-start-end-radius: 1rem; |
| .rounded-top-9 | border-start-start-radius: 1.5rem; border-start-end-radius: 1.5rem; |
| .rounded-top | border-start-start-radius: var(--bs-rounded-size, var(--bs-radius-5)); border-start-end-radius: var(--bs-rounded-size, var(--bs-radius-5)); |
| .rounded-top-circle | border-start-start-radius: 50%; border-start-end-radius: 50%; |
| .rounded-top-pill | border-start-start-radius: var(--bs-radius-pill); border-start-end-radius: var(--bs-radius-pill); |
| .rounded-end-0 | border-start-end-radius: 0; border-end-end-radius: 0; |
| .rounded-end-1 | border-start-end-radius: 0.125rem; border-end-end-radius: 0.125rem; |
| .rounded-end-2 | border-start-end-radius: 0.1875rem; border-end-end-radius: 0.1875rem; |
| .rounded-end-3 | border-start-end-radius: 0.25rem; border-end-end-radius: 0.25rem; |
| .rounded-end-4 | border-start-end-radius: 0.375rem; border-end-end-radius: 0.375rem; |
| .rounded-end-5 | border-start-end-radius: 0.5rem; border-end-end-radius: 0.5rem; |
| .rounded-end-6 | border-start-end-radius: 0.625rem; border-end-end-radius: 0.625rem; |
| .rounded-end-7 | border-start-end-radius: 0.75rem; border-end-end-radius: 0.75rem; |
| .rounded-end-8 | border-start-end-radius: 1rem; border-end-end-radius: 1rem; |
| .rounded-end-9 | border-start-end-radius: 1.5rem; border-end-end-radius: 1.5rem; |
| .rounded-end | border-start-end-radius: var(--bs-rounded-size, var(--bs-radius-5)); border-end-end-radius: var(--bs-rounded-size, var(--bs-radius-5)); |
| .rounded-end-circle | border-start-end-radius: 50%; border-end-end-radius: 50%; |
| .rounded-end-pill | border-start-end-radius: var(--bs-radius-pill); border-end-end-radius: var(--bs-radius-pill); |
| .rounded-bottom-0 | border-end-start-radius: 0; border-end-end-radius: 0; |
| .rounded-bottom-1 | border-end-start-radius: 0.125rem; border-end-end-radius: 0.125rem; |
| .rounded-bottom-2 | border-end-start-radius: 0.1875rem; border-end-end-radius: 0.1875rem; |
| .rounded-bottom-3 | border-end-start-radius: 0.25rem; border-end-end-radius: 0.25rem; |
| .rounded-bottom-4 | border-end-start-radius: 0.375rem; border-end-end-radius: 0.375rem; |
| .rounded-bottom-5 | border-end-start-radius: 0.5rem; border-end-end-radius: 0.5rem; |
| .rounded-bottom-6 | border-end-start-radius: 0.625rem; border-end-end-radius: 0.625rem; |
| .rounded-bottom-7 | border-end-start-radius: 0.75rem; border-end-end-radius: 0.75rem; |
| .rounded-bottom-8 | border-end-start-radius: 1rem; border-end-end-radius: 1rem; |
| .rounded-bottom-9 | border-end-start-radius: 1.5rem; border-end-end-radius: 1.5rem; |
| .rounded-bottom | border-end-start-radius: var(--bs-rounded-size, var(--bs-radius-5)); border-end-end-radius: var(--bs-rounded-size, var(--bs-radius-5)); |
| .rounded-bottom-circle | border-end-start-radius: 50%; border-end-end-radius: 50%; |
| .rounded-bottom-pill | border-end-start-radius: var(--bs-radius-pill); border-end-end-radius: var(--bs-radius-pill); |
| .rounded-start-0 | border-start-start-radius: 0; border-end-start-radius: 0; |
| .rounded-start-1 | border-start-start-radius: 0.125rem; border-end-start-radius: 0.125rem; |
| .rounded-start-2 | border-start-start-radius: 0.1875rem; border-end-start-radius: 0.1875rem; |
| .rounded-start-3 | border-start-start-radius: 0.25rem; border-end-start-radius: 0.25rem; |
| .rounded-start-4 | border-start-start-radius: 0.375rem; border-end-start-radius: 0.375rem; |
| .rounded-start-5 | border-start-start-radius: 0.5rem; border-end-start-radius: 0.5rem; |
| .rounded-start-6 | border-start-start-radius: 0.625rem; border-end-start-radius: 0.625rem; |
| .rounded-start-7 | border-start-start-radius: 0.75rem; border-end-start-radius: 0.75rem; |
| .rounded-start-8 | border-start-start-radius: 1rem; border-end-start-radius: 1rem; |
| .rounded-start-9 | border-start-start-radius: 1.5rem; border-end-start-radius: 1.5rem; |
| .rounded-start | border-start-start-radius: var(--bs-rounded-size, var(--bs-radius-5)); border-end-start-radius: var(--bs-rounded-size, var(--bs-radius-5)); |
| .rounded-start-circle | border-start-start-radius: 50%; border-end-start-radius: 50%; |
| .rounded-start-pill | border-start-start-radius: var(--bs-radius-pill); border-end-start-radius: var(--bs-radius-pill); |
Radius
Add classes to an element to easily round its corners.
<img src="..." class="rounded" alt="...">
<img src="..." class="rounded-top" alt="...">
<img src="..." class="rounded-end" alt="...">
<img src="..." class="rounded-bottom" alt="...">
<img src="..." class="rounded-start" alt="...">Sizes
Use the scaling classes for larger or smaller rounded corners. Sizes range from 0 to 5 including circle and pill, and can be configured by modifying the utilities API.
<img src="..." class="rounded-0" alt="...">
<img src="..." class="rounded-1" alt="...">
<img src="..." class="rounded-2" alt="...">
<img src="..." class="rounded-3" alt="...">
<img src="..." class="rounded-4" alt="...">
<img src="..." class="rounded-5" alt="...">
<img src="..." class="rounded-circle" alt="...">
<img src="..." class="rounded-pill" alt="..."><img src="..." class="rounded-bottom-1" alt="...">
<img src="..." class="rounded-start-2" alt="...">
<img src="..." class="rounded-end-circle" alt="...">
<img src="..." class="rounded-start-pill" alt="...">
<img src="..." class="rounded-5 rounded-top-0" alt="...">Mixing
Use .rounded-size-{n} to set the radius size without rounding all corners. Combine it with side classes like .rounded-top or .rounded-end to round only specific sides at that size. Because these use CSS variables for sizing, you may need to apply additional classes to nested elements to prevent inheritance.
<img src="..." class="rounded-size-6 rounded-top" alt="...">
<img src="..." class="rounded-size-6 rounded-top rounded-end" alt="...">
<img src="..." class="rounded-size-3 rounded-top rounded-bottom" alt="...">
<img src="..." class="rounded-size-pill rounded-top" alt="...">When .rounded-{n} is used alongside a side class, the number sets the --rounded-size variable that the side class inherits.
<img src="..." class="rounded-6 rounded-bottom-0" alt="...">
<img src="..." class="rounded-3 rounded-top" alt="...">CSS
Variables
Radius tokens are generated from the $spacers map in scss/_root.scss. Learn how to use the root tokens.
@each $key, $value in $spacers {
$root-tokens: map.set($root-tokens, --spacer-#{$key}, $value);
}
The --rounded-size local CSS variable is set by .rounded-{n} and .rounded-size-{n} and consumed by the side utilities (.rounded-top, .rounded-end, .rounded-bottom, .rounded-start) as their default radius. You can also set it directly in your own CSS or via an inline style to control the side utilities from a single point.
Sass maps
Sass mixins
@mixin border-radius($radius: var(--radius-5), $fallback-border-radius: false) {
@if $enable-rounded {
border-radius: valid-radius($radius);
}
@else if $fallback-border-radius != false {
border-radius: $fallback-border-radius;
}
}
@mixin border-top-radius($radius: var(--radius-5)) {
@if $enable-rounded {
border-start-start-radius: valid-radius($radius);
border-start-end-radius: valid-radius($radius);
}
}
@mixin border-end-radius($radius: var(--radius-5)) {
@if $enable-rounded {
border-start-end-radius: valid-radius($radius);
border-end-end-radius: valid-radius($radius);
}
}
@mixin border-bottom-radius($radius: var(--radius-5)) {
@if $enable-rounded {
border-end-start-radius: valid-radius($radius);
border-end-end-radius: valid-radius($radius);
}
}
@mixin border-start-radius($radius: var(--radius-5)) {
@if $enable-rounded {
border-start-start-radius: valid-radius($radius);
border-end-start-radius: valid-radius($radius);
}
}
@mixin border-top-start-radius($radius: var(--radius-5)) {
@if $enable-rounded {
border-start-start-radius: valid-radius($radius);
}
}
@mixin border-top-end-radius($radius: var(--radius-5)) {
@if $enable-rounded {
border-start-end-radius: valid-radius($radius);
}
}
@mixin border-bottom-end-radius($radius: var(--radius-5)) {
@if $enable-rounded {
border-end-end-radius: valid-radius($radius);
}
}
@mixin border-bottom-start-radius($radius: var(--radius-5)) {
@if $enable-rounded {
border-end-start-radius: valid-radius($radius);
}
}
Sass utilities API
Border utilities are declared in our utilities API in scss/_utilities.scss. Learn how to use the utilities API.
"border-radius": (
property: (
"--rounded-size": null,
"border-radius": var(--rounded-size)
),
class: rounded,
values: map.merge(
$radii,
(
null: map.get($radii, 5),
circle: 50%,
pill: var(--radius-pill)
)
)
),
"rounded-size": (
property: --rounded-size,
class: rounded-size,
values: map.merge(
$radii,
(
null: map.get($radii, 5),
circle: 50%,
pill: var(--radius-pill)
)
)
),
"rounded-top": (
property: border-start-start-radius border-start-end-radius,
class: rounded-top,
values: map.merge(
$radii,
(
null: var(--rounded-size, var(--radius-5)),
circle: 50%,
pill: var(--radius-pill)
)
)
),
"rounded-end": (
property: border-start-end-radius border-end-end-radius,
class: rounded-end,
values: map.merge(
$radii,
(
null: var(--rounded-size, var(--radius-5)),
circle: 50%,
pill: var(--radius-pill)
)
)
),
"rounded-bottom": (
property: border-end-start-radius border-end-end-radius,
class: rounded-bottom,
values: map.merge(
$radii,
(
null: var(--rounded-size, var(--radius-5)),
circle: 50%,
pill: var(--radius-pill)
)
)
),
"rounded-start": (
property: border-start-start-radius border-end-start-radius,
class: rounded-start,
values: map.merge(
$radii,
(
null: var(--rounded-size, var(--radius-5)),
circle: 50%,
pill: var(--radius-pill)
)
)
),