| 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: 0.875rem; border-radius: var(--bs-rounded-size); |
| .rounded-9 |
--bs-rounded-size: 1rem; 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: 0.875rem; border-start-end-radius: 0.875rem; |
| .rounded-top-9 |
border-start-start-radius: 1rem; border-start-end-radius: 1rem; |
| .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: 0.875rem; border-end-end-radius: 0.875rem; |
| .rounded-end-9 |
border-start-end-radius: 1rem; border-end-end-radius: 1rem; |
| .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: 0.875rem; border-end-end-radius: 0.875rem; |
| .rounded-bottom-9 |
border-end-start-radius: 1rem; border-end-end-radius: 1rem; |
| .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: 0.875rem; border-end-start-radius: 0.875rem; |
| .rounded-start-9 |
border-start-start-radius: 1rem; border-end-start-radius: 1rem; |
| .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.
<div class="rounded">rounded</div>
<div class="rounded-top">rounded-top</div>
<div class="rounded-end">rounded-end</div>
<div class="rounded-bottom">rounded-bottom</div>
<div class="rounded-start">rounded-start</div>
Sizes
Use the scaling classes for larger or smaller rounded corners. Numeric sizes range from 0 to 9. The circle and pill values are also available. Modify the utilities API to change these values.
<div class="rounded-0">rounded-0</div>
<div class="rounded-1">rounded-1</div>
<div class="rounded-2">rounded-2</div>
<div class="rounded-3">rounded-3</div>
<div class="rounded-4">rounded-4</div>
<div class="rounded-5">rounded-5</div>
<div class="rounded-6">rounded-6</div>
<div class="rounded-7">rounded-7</div>
<div class="rounded-8">rounded-8</div>
<div class="rounded-9">rounded-9</div>
<div class="rounded-circle">rounded-circle</div>
<div class="rounded-pill">rounded-pill</div>
<div class="rounded-bottom-1">rounded-bottom-1</div>
<div class="rounded-start-2">rounded-start-2</div>
<div class="rounded-end-circle">rounded-end-circle</div>
<div class="rounded-start-pill">rounded-start-pill</div>
<div class="rounded-5 rounded-top-0">rounded-5 rounded-top-0</div>
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.
<div class="rounded-size-6 rounded-top">rounded-size-6 rounded-top</div>
<div class="rounded-size-6 rounded-top rounded-end">rounded-size-6 rounded-top rounded-end</div>
<div class="rounded-size-3 rounded-top rounded-bottom">rounded-size-3 rounded-top rounded-bottom</div>
<div class="rounded-size-pill rounded-top">rounded-size-pill rounded-top</div>
When .rounded-{n} is used alongside a side class, the number sets the --rounded-size variable that the side class inherits.
<div class="rounded-6 rounded-bottom-0">rounded-6 rounded-bottom-0</div>
<div class="rounded-3 rounded-top">rounded-3 rounded-top</div>
CSS
Variables
Radius tokens are generated from the $radii map in scss/_config.scss and emitted as --radius-* custom properties in scss/_root.scss. Learn how to use the root tokens.
@each $key, $value in $radii {
$root-tokens: map.set($root-tokens, --radius-#{$key}, $value);
}
// There is no `$radii` step for the pill, so keep a value passed through `$root-tokens`.
@if not map.has-key($root-tokens, --radius-pill) {
$root-tokens: map.set($root-tokens, --radius-pill, 50rem);
}
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
$radius: .5rem;
$radii: ();
// stylelint-disable-next-line scss/dollar-variable-default
$radii: defaults(
(
0: 0,
1: $radius * .25,
2: $radius * .375,
3: $radius * .5,
4: $radius * .75,
5: $radius,
6: $radius * 1.25,
7: $radius * 1.5,
8: $radius * 1.75,
9: $radius * 2,
),
$radii
);
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)
)
)
),