Tailwind CSS v1.0 is here! Learn more →

Border Width

Utilities for controlling the width of an element's borders.

Work in progress!

More detailed documentation is coming soon, but in the meantime here's a quick class reference.

Add borders to any element using the .border{-side?}{-width?} syntax.

For example, .border would add a 1px border to all sides of the element, where .border-b-4 would add a 4px border to the bottom of the element.

Class
border
Side (optional)
  All (default)
t Top
r Right
b Bottom
l Left
Width (optional)
0 0px
  1px (default)
2 2px
4 4px
8 8px

Customizing

Responsive and State Variants

By default, only responsive variants are generated for border width utilities.

You can control which variants are generated for the border width utilities by modifying the borderWidths property in the modules section of your Tailwind config file.

For example, this config will also generate hover and focus variants:

{
// ...
modules: {
    // ...
-   borderWidths: ['responsive'],
+   borderWidths: ['responsive', 'hover', 'focus', 'active', 'group-hover'],
}
}

Disabling

If you don't plan to use the border width utilities in your project, you can disable them entirely by setting the borderWidths property to false in the modules section of your config file:

{
// ...
modules: {
    // ...
-   borderWidths: ['responsive'],
+   borderWidths: false,
}
}