Skip to content

Want to skip the docs? Check out pandamastery.com - the best way to learn Panda CSS

Utility Reference

Border

Panda's border utilities.

Panda provides CSS properties for styling borders.

Compound Properties

The border compound property maps to the borders token category.

PropCSS PropertyToken Category
borderborderborders
borderX , borderInlineborderInlineborders
borderY , borderBlockborderBlockborders
borderStart , borderInlineStartborderInlineStartborders
borderEnd , borderInlineEndborderInlineEndborders

Border Radius

All sides

<div className={css({ borderRadius: 'md' })} />
<div className={css({ rounded: 'md' })} /> // shorthand

Specific sides

Use the border{Left|Right|Top|Bottom}Radius properties, or the shorthand equivalent to apply border radius on a specific side of an element.

<div className={css({ borderTopRadius: 'md' })} />
<div className={css({ roundedTop: 'md' })} /> // shorthand
 
<div className={css({ borderLeftRadius: 'md' })} />
<div className={css({ roundedLeft: 'md' })} /> // shorthand

Specific corners

Use the border{Top|Bottom}{Left|Right}Radius properties, or the shorthand equivalent to round a specific corner.

<div className={css({ borderTopLeftRadius: 'md' })} />
<div className={css({ roundedTopLeft: 'md' })} /> // shorthand
PropCSS PropertyToken Category
rounded,borderRadiusborder-radiusradii
roundedTopLeft,borderTopLeftRadiusborder-top-left-radiusradii
roundedTopRight,borderTopRightborder-top-right-radiusradii
roundedBottomRight,borderBottomRightborder-bottom-right-radiusradii
roundedBottomLeft,borderBottomLeftborder-bottom-left-radiusradii
roundedTop,borderTopRadiusborder-top-{left+right}-radiusradii
roundedRight,borderRightRadiusborder-{top+bottom}-right-radiusradii
roundedBottom,borderBottomRadiusborder-bottom-{left+right}-radiusradii
roundedLeft,borderLeftRadiusborder-{top+bottom}-left-radiusradii

Logical Properties

Panda also provides the logical properties for border radius, which map to corresponding physical properties based on the document's writing mode.

💡

For example, borderStartRadius will map to border-left-radius in LTR mode, and border-right-radius in RTL mode.

<div className={css({ borderStartRadius: 'md' })} />
<div className={css({ roundedStart: 'md' })} /> // shorthand
PropCSS PropertyToken Category
roundedStartStart,borderStartStartRadiusborder-start-start-radiusradii
roundedStartEnd,borderStartEndRadiusborder-start-end-radiusradii
roundedStart,borderStartRadiusborder-{start+end}-start-radiusradii
roundedEndStart,borderEndStartRadiusborder-end-start-radiusradii
roundedEndEnd,borderEndEndRadiusborder-end-end-radiusradii
roundedEnd ,borderEndRadiusborder-{start+end}-end-radiusradii

Border Width

All sides

<div className={css({ borderWidth: '1px' })} />

Specific sides

Use the border{Left|Right|Top|Bottom}Width properties, to apply border width on a specific side of an element.

<div className={css({ borderTopWidth: '1px' })} />
<div className={css({ borderLeftWidth: '1px' })} />
PropCSS Property
borderWidthborder-width
borderTopWidthborder-top-width
borderLeftWidthborder-left-width
borderRightWidthborder-right-width
borderBottomWidthborder-bottom-width
borderXWidth , borderInlineWidthborder-{left+right}-width
borderYWidth , borderBlockWidthborder-{top+bottom}-width

Logical Properties

Panda also provides the logical properties for border width, which map to corresponding physical properties based on the document's writing mode.

💡

For example, borderStartWidth will map to border-left-width in LTR mode, and border-right-width in RTL mode.

<div className={css({ borderStartWidth: '1px' })} />
PropCSS Property
borderStartWidth , borderInlineStartWidthborder-{start+end}-width
borderEndWidth , borderInlineEndWidthborder-{start+end}-width

Border Color

The border color utilities are used to set the border color of an element. It references the colors token category.

All sides

<div className={css({ borderColor: 'primary' })} />

Specific sides

Use the border{Left|Right|Top|Bottom}Color properties to apply border color on a specific side of an element.

<div className={css({ borderTopColor: 'primary' })} />
<div className={css({ borderLeftColor: 'primary' })} />
PropCSS PropertyToken Category
borderColorborder-colorcolors
borderTopColorborder-top-colorcolors
borderLeftColorborder-left-colorcolors
borderRightColorborder-right-colorcolors
borderBottomColorborder-bottom-colorcolors

Logical Properties

Panda also provides the logical properties for border color, which map to corresponding physical properties based on the document's writing mode.

💡

For example, borderInlineStartColor will map to border-left-color in LTR mode, and border-right-color in RTL mode.

<div className={css({ borderInlineStartColor: 'red.500' })} />
PropCSS PropertyToken Category
borderStartColor , borderInlineStartColorborder-{start+end}-colorcolors
borderEndColor , borderInlineEndColorborder-{start+end}-colorcolors
borderXColor, borderInlineColorborder-inline-colorcolors
borderYColor, borderBlockColorborder-block-colorcolors

Full reference

Generated from @pandacss/preset-base, so this table always matches the utilities Panda ships.

Border · 44
PropertyShorthandClassValues
borderbdborders
borderBlockborderYbd-yborders
borderBlockColorborderYColorbd-y-ccolors
borderBlockEndbd-beborders
borderBlockEndColorbd-be-ccolors
borderBlockStartbd-bsborders
borderBlockStartColorbd-bs-ccolors
borderBlockWidthborderYWidthbd-y-wborderWidths
borderBottombd-bborders
borderBottomColorbd-b-ccolors
borderBottomWidthbd-b-wborderWidths
borderColorbd-ccolors
borderInlineborderXbd-xborders
borderInlineColorborderXColorbd-x-ccolors
borderInlineEndborderEndbd-eborders
borderInlineEndColorborderEndColorbd-e-ccolors
borderInlineEndWidthborderEndWidthbd-e-wborderWidths
borderInlineStartborderStartbd-sborders
borderInlineStartColorborderStartColorbd-s-ccolors
borderInlineStartWidthborderStartWidthbd-s-wborderWidths
borderInlineWidthborderXWidthbd-x-wborderWidths
borderLeftbd-lborders
borderLeftColorbd-l-ccolors
borderLeftWidthbd-l-wborderWidths
borderRightbd-rborders
borderRightColorbd-r-ccolors
borderRightWidthbd-r-wborderWidths
borderTopbd-tborders
borderTopColorbd-t-ccolors
borderTopWidthbd-t-wborderWidths
divideColordvd-ccolors
divideStyledvd-s
divideXdvd-xborderWidths
divideYdvd-yborderWidths
outlineringringborders
outlineOffsetringOffsetring-ospacing
outlineWidthringWidthring-wborderWidths
strokeDasharraystk-dsh
strokeDashoffsetstk-do
strokeLinecapstk-lc
strokeLinejoinstk-lj
strokeMiterlimitstk-ml
strokeOpacitystk-op
strokeWidthstk-wborderWidths
Border Radius · 18
PropertyShorthandClassValues
borderBlockEndWidthbd-be-wborderWidths
borderBlockStartWidthbd-bs-wborderWidths
borderBottomLeftRadiusroundedBottomLeftbdr-blradii
borderBottomRadiusroundedBottombdr-bradii
borderBottomRightRadiusroundedBottomRightbdr-brradii
borderEndEndRadiusroundedEndEndbdr-eeradii
borderEndRadiusroundedEndbdr-eradii
borderEndStartRadiusroundedEndStartbdr-esradii
borderLeftRadiusroundedLeftbdr-lradii
borderRadiusroundedbdrradii
borderRightRadiusroundedRightbdr-rradii
borderStartEndRadiusroundedStartEndbdr-seradii
borderStartRadiusroundedStartbdr-sradii
borderStartStartRadiusroundedStartStartbdr-ssradii
borderTopLeftRadiusroundedTopLeftbdr-tlradii
borderTopRadiusroundedTopbdr-tradii
borderTopRightRadiusroundedTopRightbdr-trradii
borderWidthbd-wborderWidths
Edit this page on GitHubView as markdown
Last updated on