Border Radius

Utilities for controlling the border radius of an element.

Class reference

Class
Properties
.rounded-noneborder-radius: 0;
.rounded-smborder-radius: 0.125rem;
.roundedborder-radius: 0.25rem;
.rounded-mdborder-radius: 0.375rem;
.rounded-lgborder-radius: 0.5rem;
.rounded-xlborder-radius: 0.75rem;
.rounded-2xlborder-radius: 1rem;
.rounded-3xlborder-radius: 1.5rem;
.rounded-fullborder-radius: 9999px;
.rounded-t-noneborder-top-left-radius: 0; border-top-right-radius: 0;
.rounded-r-noneborder-top-right-radius: 0; border-bottom-right-radius: 0;
.rounded-b-noneborder-bottom-right-radius: 0; border-bottom-left-radius: 0;
.rounded-l-noneborder-top-left-radius: 0; border-bottom-left-radius: 0;
.rounded-t-smborder-top-left-radius: 0.125rem; border-top-right-radius: 0.125rem;
.rounded-r-smborder-top-right-radius: 0.125rem; border-bottom-right-radius: 0.125rem;
.rounded-b-smborder-bottom-right-radius: 0.125rem; border-bottom-left-radius: 0.125rem;
.rounded-l-smborder-top-left-radius: 0.125rem; border-bottom-left-radius: 0.125rem;
.rounded-tborder-top-left-radius: 0.25rem; border-top-right-radius: 0.25rem;
.rounded-rborder-top-right-radius: 0.25rem; border-bottom-right-radius: 0.25rem;
.rounded-bborder-bottom-right-radius: 0.25rem; border-bottom-left-radius: 0.25rem;
.rounded-lborder-top-left-radius: 0.25rem; border-bottom-left-radius: 0.25rem;
.rounded-t-mdborder-top-left-radius: 0.375rem; border-top-right-radius: 0.375rem;
.rounded-r-mdborder-top-right-radius: 0.375rem; border-bottom-right-radius: 0.375rem;
.rounded-b-mdborder-bottom-right-radius: 0.375rem; border-bottom-left-radius: 0.375rem;
.rounded-l-mdborder-top-left-radius: 0.375rem; border-bottom-left-radius: 0.375rem;
.rounded-t-lgborder-top-left-radius: 0.5rem; border-top-right-radius: 0.5rem;
.rounded-r-lgborder-top-right-radius: 0.5rem; border-bottom-right-radius: 0.5rem;
.rounded-b-lgborder-bottom-right-radius: 0.5rem; border-bottom-left-radius: 0.5rem;
.rounded-l-lgborder-top-left-radius: 0.5rem; border-bottom-left-radius: 0.5rem;
.rounded-t-xlborder-top-left-radius: 0.75rem; border-top-right-radius: 0.75rem;
.rounded-r-xlborder-top-right-radius: 0.75rem; border-bottom-right-radius: 0.75rem;
.rounded-b-xlborder-bottom-right-radius: 0.75rem; border-bottom-left-radius: 0.75rem;
.rounded-l-xlborder-top-left-radius: 0.75rem; border-bottom-left-radius: 0.75rem;
.rounded-t-2xlborder-top-left-radius: 1rem; border-top-right-radius: 1rem;
.rounded-r-2xlborder-top-right-radius: 1rem; border-bottom-right-radius: 1rem;
.rounded-b-2xlborder-bottom-right-radius: 1rem; border-bottom-left-radius: 1rem;
.rounded-l-2xlborder-top-left-radius: 1rem; border-bottom-left-radius: 1rem;
.rounded-t-3xlborder-top-left-radius: 1.5rem; border-top-right-radius: 1.5rem;
.rounded-r-3xlborder-top-right-radius: 1.5rem; border-bottom-right-radius: 1.5rem;
.rounded-b-3xlborder-bottom-right-radius: 1.5rem; border-bottom-left-radius: 1.5rem;
.rounded-l-3xlborder-top-left-radius: 1.5rem; border-bottom-left-radius: 1.5rem;
.rounded-t-fullborder-top-left-radius: 9999px; border-top-right-radius: 9999px;
.rounded-r-fullborder-top-right-radius: 9999px; border-bottom-right-radius: 9999px;
.rounded-b-fullborder-bottom-right-radius: 9999px; border-bottom-left-radius: 9999px;
.rounded-l-fullborder-top-left-radius: 9999px; border-bottom-left-radius: 9999px;
.rounded-tl-noneborder-top-left-radius: 0;
.rounded-tr-noneborder-top-right-radius: 0;
.rounded-br-noneborder-bottom-right-radius: 0;
.rounded-bl-noneborder-bottom-left-radius: 0;
.rounded-tl-smborder-top-left-radius: 0.125rem;
.rounded-tr-smborder-top-right-radius: 0.125rem;
.rounded-br-smborder-bottom-right-radius: 0.125rem;
.rounded-bl-smborder-bottom-left-radius: 0.125rem;
.rounded-tlborder-top-left-radius: 0.25rem;
.rounded-trborder-top-right-radius: 0.25rem;
.rounded-brborder-bottom-right-radius: 0.25rem;
.rounded-blborder-bottom-left-radius: 0.25rem;
.rounded-tl-mdborder-top-left-radius: 0.375rem;
.rounded-tr-mdborder-top-right-radius: 0.375rem;
.rounded-br-mdborder-bottom-right-radius: 0.375rem;
.rounded-bl-mdborder-bottom-left-radius: 0.375rem;
.rounded-tl-lgborder-top-left-radius: 0.5rem;
.rounded-tr-lgborder-top-right-radius: 0.5rem;
.rounded-br-lgborder-bottom-right-radius: 0.5rem;
.rounded-bl-lgborder-bottom-left-radius: 0.5rem;
.rounded-tl-xlborder-top-left-radius: 0.75rem;
.rounded-tr-xlborder-top-right-radius: 0.75rem;
.rounded-br-xlborder-bottom-right-radius: 0.75rem;
.rounded-bl-xlborder-bottom-left-radius: 0.75rem;
.rounded-tl-2xlborder-top-left-radius: 1rem;
.rounded-tr-2xlborder-top-right-radius: 1rem;
.rounded-br-2xlborder-bottom-right-radius: 1rem;
.rounded-bl-2xlborder-bottom-left-radius: 1rem;
.rounded-tl-3xlborder-top-left-radius: 1.5rem;
.rounded-tr-3xlborder-top-right-radius: 1.5rem;
.rounded-br-3xlborder-bottom-right-radius: 1.5rem;
.rounded-bl-3xlborder-bottom-left-radius: 1.5rem;
.rounded-tl-fullborder-top-left-radius: 9999px;
.rounded-tr-fullborder-top-right-radius: 9999px;
.rounded-br-fullborder-bottom-right-radius: 9999px;
.rounded-bl-fullborder-bottom-left-radius: 9999px;

Rounded corners

Use utilities like .rounded-sm, .rounded, or .rounded-lg to apply different border radius sizes to an element.

Border Radius - 图1

  1. <div class="rounded-sm"></div>
  2. <div class="rounded"></div>
  3. <div class="rounded-md"></div>
  4. <div class="rounded-lg"></div>

Pills and circles

Use the .rounded-full utility to create pills and circles.

Border Radius - 图2

  1. <div class="rounded-full py-2 px-4">Pill shape</div>
  2. <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.

Border Radius - 图3

  1. <div class="rounded-none"></div>

Rounding sides separately

Use .rounded-{t|r|b|l}{-size?} to only round one side an element.

Border Radius - 图4

  1. <div class="rounded-t-lg"></div>
  2. <div class="rounded-r-lg"></div>
  3. <div class="rounded-b-lg"></div>
  4. <div class="rounded-l-lg"></div>

Rounding corners separately

Use .rounded-{tl|tr|br|bl}{-size?} to only round one corner an element.

Border Radius - 图5

  1. <div class="rounded-tl-lg"></div>
  2. <div class="rounded-tr-lg"></div>
  3. <div class="rounded-br-lg"></div>
  4. <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.

Border Radius - 图6

all

Border Radius - 图7

sm

Border Radius - 图8

md

Border Radius - 图9

lg

Border Radius - 图10

xl

  1. <div class="rounded sm:rounded-t md:rounded-b-lg lg:rounded-none xl:rounded-r ...">
  2. <!-- ... -->
  3. </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.

  1. // tailwind.config.js
  2. module.exports = {
  3. theme: {
  4. borderRadius: {
  5. 'none': '0',
  6. - 'sm': '0.125rem',
  7. - default: '0.25rem',
  8. + default: '4px',
  9. - 'md': '0.375rem',
  10. - 'lg': '0.5rem',
  11. - 'full': '9999px',
  12. + 'large': '12px',
  13. }
  14. }
  15. }

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:

  1. // tailwind.config.js
  2. module.exports = {
  3. variants: {
  4. // ...
  5. - borderRadius: ['responsive'],
  6. + borderRadius: ['responsive', 'hover', 'focus'],
  7. }
  8. }

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:

  1. // tailwind.config.js
  2. module.exports = {
  3. corePlugins: {
  4. // ...
  5. + borderRadius: false,
  6. }
  7. }

← Gradient Color Stops   Border Width →