Borders

Utilities for controlling border width, style, color, radius, ring outlines, and dividers between child elements.

Border Width

ClassCSS Property
border-0border-width: var(--border-width-0)
borderborder-width: var(--border-width)
border-2border-width: var(--border-width-2)
border-tborder-top-width: var(--border-width)
border-bborder-bottom-width: var(--border-width)

Border Style

ClassCSS Property
border-solidborder-style: solid
border-dashedborder-style: dashed
border-noneborder-style: none

Border Color

ClassCSS Property
border-transparentborder-color: transparent
border-currentborder-color: currentColor
border-gray-200border-color: var(--color-gray-200)
border-gray-300border-color: var(--color-gray-300)
border-blue-500border-color: var(--color-blue-500)

Example

border-gray-200
border-2 border-blue-500
border-dashed
<div class="border border-gray-200 rounded p-4">Default border</div> <div class="border-2 border-blue-500 rounded p-4">Thick blue border</div> <div class="border-2 border-dashed border-gray-300 rounded p-4">Dashed border</div>

Border Radius

ClassCSS Property
rounded-noneborder-radius: var(--radius-none)
rounded-smborder-radius: var(--radius-sm)
roundedborder-radius: var(--radius)
rounded-mdborder-radius: var(--radius-md)
rounded-lgborder-radius: var(--radius-lg)
rounded-xlborder-radius: var(--radius-xl)
rounded-2xlborder-radius: var(--radius-2xl)
rounded-fullborder-radius: var(--radius-full)

Example

none
sm
default
md
lg
xl
2xl
full
<div class="bg-blue-500 rounded-none">...</div> <div class="bg-blue-500 rounded-lg">...</div> <div class="bg-blue-500 rounded-full">...</div>

Ring

Ring utilities add box-shadow outlines, useful for focus states.

ClassCSS Property
ring-0box-shadow: 0 0 0 0px var(--ring-color)
ring-1box-shadow: 0 0 0 1px var(--ring-color)
ring-2box-shadow: 0 0 0 2px var(--ring-color)
ring-blue-500--ring-color: var(--color-blue-500)

Example

ring-1
ring-2
<div class="ring-2 ring-blue-500 rounded-lg p-4"> Ring outline </div>

Divide

Add borders between child elements.

ClassCSS Property
divide-y> * + * { border-top-width: 1px }
divide-x> * + * { border-left-width: 1px }

Example

First item
Second item
Third item
<div class="divide-y"> <div class="py-3">First item</div> <div class="py-3">Second item</div> <div class="py-3">Third item</div> </div>