Border radius

Source: https://getbootstrap.com/docs/6.0/utilities/border-radius

Use border radius…

Radius

Add classes to an element to easily round its corners.

<Placeholder width="75" height="75" class="rounded-start" title="Example left rounded image" />`} />

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.

<Placeholder width="150" height="75" class="rounded-pill" title="Rounded pill image" />`} />

<Placeholder width="75" height="75" class="rounded-5 rounded-top-0" title="Example extra large bottom rounded image" />`} />

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.

<Placeholder width="75" height="75" class="rounded-size-pill rounded-top" title="Top corners only, pill" />`} />

When .rounded-{n} is used alongside a side class, the number sets the --rounded-size variable that the side class inherits.

<Placeholder width="75" height="75" class="rounded-3 rounded-top" title="All corners size 3, top corners stay size 3 via --rounded-size" />`} />

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.

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

Sass utilities API

Border utilities are declared in our utilities API in scss/_utilities.scss. Learn how to use the utilities API.