Border Radius
Utilities for controlling the border radius of an element.
Class reference
Class | Properties |
---|---|
.rounded-none | border-radius: 0; |
.rounded-sm | border-radius: 0.125rem; |
.rounded | border-radius: 0.25rem; |
.rounded-md | border-radius: 0.375rem; |
.rounded-lg | border-radius: 0.5rem; |
.rounded-xl | border-radius: 0.75rem; |
.rounded-2xl | border-radius: 1rem; |
.rounded-3xl | border-radius: 1.5rem; |
.rounded-full | border-radius: 9999px; |
.rounded-t-none | border-top-left-radius: 0; border-top-right-radius: 0; |
.rounded-r-none | border-top-right-radius: 0; border-bottom-right-radius: 0; |
.rounded-b-none | border-bottom-right-radius: 0; border-bottom-left-radius: 0; |
.rounded-l-none | border-top-left-radius: 0; border-bottom-left-radius: 0; |
.rounded-t-sm | border-top-left-radius: 0.125rem; border-top-right-radius: 0.125rem; |
.rounded-r-sm | border-top-right-radius: 0.125rem; border-bottom-right-radius: 0.125rem; |
.rounded-b-sm | border-bottom-right-radius: 0.125rem; border-bottom-left-radius: 0.125rem; |
.rounded-l-sm | border-top-left-radius: 0.125rem; border-bottom-left-radius: 0.125rem; |
.rounded-t | border-top-left-radius: 0.25rem; border-top-right-radius: 0.25rem; |
.rounded-r | border-top-right-radius: 0.25rem; border-bottom-right-radius: 0.25rem; |
.rounded-b | border-bottom-right-radius: 0.25rem; border-bottom-left-radius: 0.25rem; |
.rounded-l | border-top-left-radius: 0.25rem; border-bottom-left-radius: 0.25rem; |
.rounded-t-md | border-top-left-radius: 0.375rem; border-top-right-radius: 0.375rem; |
.rounded-r-md | border-top-right-radius: 0.375rem; border-bottom-right-radius: 0.375rem; |
.rounded-b-md | border-bottom-right-radius: 0.375rem; border-bottom-left-radius: 0.375rem; |
.rounded-l-md | border-top-left-radius: 0.375rem; border-bottom-left-radius: 0.375rem; |
.rounded-t-lg | border-top-left-radius: 0.5rem; border-top-right-radius: 0.5rem; |
.rounded-r-lg | border-top-right-radius: 0.5rem; border-bottom-right-radius: 0.5rem; |
.rounded-b-lg | border-bottom-right-radius: 0.5rem; border-bottom-left-radius: 0.5rem; |
.rounded-l-lg | border-top-left-radius: 0.5rem; border-bottom-left-radius: 0.5rem; |
.rounded-t-xl | border-top-left-radius: 0.75rem; border-top-right-radius: 0.75rem; |
.rounded-r-xl | border-top-right-radius: 0.75rem; border-bottom-right-radius: 0.75rem; |
.rounded-b-xl | border-bottom-right-radius: 0.75rem; border-bottom-left-radius: 0.75rem; |
.rounded-l-xl | border-top-left-radius: 0.75rem; border-bottom-left-radius: 0.75rem; |
.rounded-t-2xl | border-top-left-radius: 1rem; border-top-right-radius: 1rem; |
.rounded-r-2xl | border-top-right-radius: 1rem; border-bottom-right-radius: 1rem; |
.rounded-b-2xl | border-bottom-right-radius: 1rem; border-bottom-left-radius: 1rem; |
.rounded-l-2xl | border-top-left-radius: 1rem; border-bottom-left-radius: 1rem; |
.rounded-t-3xl | border-top-left-radius: 1.5rem; border-top-right-radius: 1.5rem; |
.rounded-r-3xl | border-top-right-radius: 1.5rem; border-bottom-right-radius: 1.5rem; |
.rounded-b-3xl | border-bottom-right-radius: 1.5rem; border-bottom-left-radius: 1.5rem; |
.rounded-l-3xl | border-top-left-radius: 1.5rem; border-bottom-left-radius: 1.5rem; |
.rounded-t-full | border-top-left-radius: 9999px; border-top-right-radius: 9999px; |
.rounded-r-full | border-top-right-radius: 9999px; border-bottom-right-radius: 9999px; |
.rounded-b-full | border-bottom-right-radius: 9999px; border-bottom-left-radius: 9999px; |
.rounded-l-full | border-top-left-radius: 9999px; border-bottom-left-radius: 9999px; |
.rounded-tl-none | border-top-left-radius: 0; |
.rounded-tr-none | border-top-right-radius: 0; |
.rounded-br-none | border-bottom-right-radius: 0; |
.rounded-bl-none | border-bottom-left-radius: 0; |
.rounded-tl-sm | border-top-left-radius: 0.125rem; |
.rounded-tr-sm | border-top-right-radius: 0.125rem; |
.rounded-br-sm | border-bottom-right-radius: 0.125rem; |
.rounded-bl-sm | border-bottom-left-radius: 0.125rem; |
.rounded-tl | border-top-left-radius: 0.25rem; |
.rounded-tr | border-top-right-radius: 0.25rem; |
.rounded-br | border-bottom-right-radius: 0.25rem; |
.rounded-bl | border-bottom-left-radius: 0.25rem; |
.rounded-tl-md | border-top-left-radius: 0.375rem; |
.rounded-tr-md | border-top-right-radius: 0.375rem; |
.rounded-br-md | border-bottom-right-radius: 0.375rem; |
.rounded-bl-md | border-bottom-left-radius: 0.375rem; |
.rounded-tl-lg | border-top-left-radius: 0.5rem; |
.rounded-tr-lg | border-top-right-radius: 0.5rem; |
.rounded-br-lg | border-bottom-right-radius: 0.5rem; |
.rounded-bl-lg | border-bottom-left-radius: 0.5rem; |
.rounded-tl-xl | border-top-left-radius: 0.75rem; |
.rounded-tr-xl | border-top-right-radius: 0.75rem; |
.rounded-br-xl | border-bottom-right-radius: 0.75rem; |
.rounded-bl-xl | border-bottom-left-radius: 0.75rem; |
.rounded-tl-2xl | border-top-left-radius: 1rem; |
.rounded-tr-2xl | border-top-right-radius: 1rem; |
.rounded-br-2xl | border-bottom-right-radius: 1rem; |
.rounded-bl-2xl | border-bottom-left-radius: 1rem; |
.rounded-tl-3xl | border-top-left-radius: 1.5rem; |
.rounded-tr-3xl | border-top-right-radius: 1.5rem; |
.rounded-br-3xl | border-bottom-right-radius: 1.5rem; |
.rounded-bl-3xl | border-bottom-left-radius: 1.5rem; |
.rounded-tl-full | border-top-left-radius: 9999px; |
.rounded-tr-full | border-top-right-radius: 9999px; |
.rounded-br-full | border-bottom-right-radius: 9999px; |
.rounded-bl-full | border-bottom-left-radius: 9999px; |
Rounded corners
Use utilities like .rounded-sm
, .rounded
, or .rounded-lg
to apply different border radius sizes to an element.
<div class="rounded-sm"></div>
<div class="rounded"></div>
<div class="rounded-md"></div>
<div class="rounded-lg"></div>
Pills and circles
Use the .rounded-full
utility to create pills and circles.
<div class="rounded-full py-2 px-4">Pill shape</div>
<div class="rounded-full h-16 w-16 flex items-center justify-center">Circle</div>
No rounding
Use .rounded-none
to remove an existing border radius from an element.
This is most commonly used to remove a border radius that was applied at a smaller breakpoint.
<div class="rounded-none"></div>
Rounding sides separately
Use .rounded-{t|r|b|l}{-size?}
to only round one side an element.
<div class="rounded-t-lg"></div>
<div class="rounded-r-lg"></div>
<div class="rounded-b-lg"></div>
<div class="rounded-l-lg"></div>
Rounding corners separately
Use .rounded-{tl|tr|br|bl}{-size?}
to only round one corner an element.
<div class="rounded-tl-lg"></div>
<div class="rounded-tr-lg"></div>
<div class="rounded-br-lg"></div>
<div class="rounded-bl-lg"></div>
Responsive
To control the border radius of an element at a specific breakpoint, add a {screen}:
prefix to any existing border radius utility. For example, use md:rounded-lg
to apply the rounded-lg
utility at only medium screen sizes and above.
For more information about Tailwind’s responsive design features, check out the Responsive Design documentation.
all
sm
md
lg
xl
<div class="rounded sm:rounded-t md:rounded-b-lg lg:rounded-none xl:rounded-r ...">
<!-- ... -->
</div>
Customizing
Border Radiuses
By default Tailwind provides five border radius size utilities. You can change, add, or remove these by editing the theme.borderRadius
section of your Tailwind config.
// tailwind.config.js
module.exports = {
theme: {
borderRadius: {
'none': '0',
- 'sm': '0.125rem',
- default: '0.25rem',
+ default: '4px',
- 'md': '0.375rem',
- 'lg': '0.5rem',
- 'full': '9999px',
+ 'large': '12px',
}
}
}
Responsive and pseudo-class variants
By default, only responsive variants are generated for border radius utilities.
You can control which variants are generated for the border radius utilities by modifying the borderRadius
property in the variants
section of your tailwind.config.js
file.
For example, this config will also generate hover and focus variants:
// tailwind.config.js
module.exports = {
variants: {
// ...
- borderRadius: ['responsive'],
+ borderRadius: ['responsive', 'hover', 'focus'],
}
}
Disabling
If you don’t plan to use the border radius utilities in your project, you can disable them entirely by setting the borderRadius
property to false
in the corePlugins
section of your config file:
// tailwind.config.js
module.exports = {
corePlugins: {
// ...
+ borderRadius: false,
}
}