Utilities

Utility Props

Every Componentry component accepts a standard set of utility props. These provide easy access to theme styling using utility classes.

<Block mt={2}>Easy themed spacing</Block> // ^ utility prop "mt" converted to utility class "mt-2"

TypeScript customization

Module augmentation enables overriding the library defined utility props values using the UtilityPropsOverrides in componentry/types/utils/utility-classes.

declare module 'componentry/types/utils/utility-classes' { // eg customizing allowed fontSize values interface UtilityPropsOverrides { fontSize: 'body' | 'sm' | 'lg' | 'display' } }

Available Props

Props

Name
Description
active

string | boolean
alignContent

"center" | "start" | "end" | "stretch" | "space-between" | "space-around" | "space-evenly"
alignItems

"center" | "start" | "end" | "stretch" | "baseline"
alignSelf

"auto" | "center" | "start" | "end" | "stretch" | "baseline"
backgroundColor

string
bold

boolean
border

boolean
borderBottom

boolean
borderColor

undefined
borderLeft

boolean
borderRadius

boolean | "none" | "full" | "sm" | "lg" | "md" | "xl" | "2xl" | "3xl"
borderRight

boolean
borderStyle

"dashed" | "dotted" | "double" | "hidden" | "none" | "solid"
borderTop

boolean
borderWidth

"0" | "1" | "2" | "4" | "8"
boxShadow

boolean
color

string
columnGap

"0" | "10" | "1" | "1.5" | "2" | "px" | "0.5" | "2.5" | "3" | "4" | "5" | "6" | "8" | "12" | "14" | "16" | "20" | "24" | "32" | "48" | "64"
disabled

boolean
display

"hidden" | "block" | "contents" | "flex" | "flow-root" | "grid" | "inline" | "inline-block" | "inline-flex" | "inline-grid" | "list-item"
flexDirection

"column" | "column-reverse" | "row-reverse" | "row"
flexGrow

boolean | "0"
flexShrink

boolean | "0"
flexWrap

"wrap" | "nowrap" | "wrap-reverse"
fontFamily

"body" | "mono"
fontSize

"inherit" | "base" | "body" | "h1" | "h2" | "h3" | "sm" | "lg"
fontWeight

"light" | "normal" | "bold"
gap

"0" | "10" | "1" | "1.5" | "2" | "px" | "0.5" | "2.5" | "3" | "4" | "5" | "6" | "8" | "12" | "14" | "16" | "20" | "24" | "32" | "48" | "64"
height

HeightBase
invisible

boolean
italic

boolean
justifyContent

"center" | "start" | "end" | "space-between" | "space-around" | "space-evenly"
justifyItems

"center" | "start" | "end" | "stretch"
justifySelf

"auto" | "center" | "start" | "end" | "stretch"
letterSpacing

"normal" | "tighter" | "tight" | "wide" | "wider" | "widest"
lineHeight

"none" | "normal"
m

"0" | "auto" | "10" | "1" | "1.5" | "2" | "px" | "0.5" | "2.5" | "3" | "4" | "5" | "6" | "8" | "12" | "14" | "16" | "20" | "24" | "32" | "48" | "64"
maxHeight

MaxHeightBase
maxWidth

MaxWidthBase
mb

"0" | "auto" | "10" | "1" | "1.5" | "2" | "px" | "0.5" | "2.5" | "3" | "4" | "5" | "6" | "8" | "12" | "14" | "16" | "20" | "24" | "32" | "48" | "64"
minHeight

MinHeightBase
minWidth

MinWidthBase
ml

"0" | "auto" | "10" | "1" | "1.5" | "2" | "px" | "0.5" | "2.5" | "3" | "4" | "5" | "6" | "8" | "12" | "14" | "16" | "20" | "24" | "32" | "48" | "64"
mr

"0" | "auto" | "10" | "1" | "1.5" | "2" | "px" | "0.5" | "2.5" | "3" | "4" | "5" | "6" | "8" | "12" | "14" | "16" | "20" | "24" | "32" | "48" | "64"
mt

"0" | "auto" | "10" | "1" | "1.5" | "2" | "px" | "0.5" | "2.5" | "3" | "4" | "5" | "6" | "8" | "12" | "14" | "16" | "20" | "24" | "32" | "48" | "64"
mx

"0" | "auto" | "10" | "1" | "1.5" | "2" | "px" | "0.5" | "2.5" | "3" | "4" | "5" | "6" | "8" | "12" | "14" | "16" | "20" | "24" | "32" | "48" | "64"
my

"0" | "auto" | "10" | "1" | "1.5" | "2" | "px" | "0.5" | "2.5" | "3" | "4" | "5" | "6" | "8" | "12" | "14" | "16" | "20" | "24" | "32" | "48" | "64"
p

"0" | "auto" | "10" | "1" | "1.5" | "2" | "px" | "0.5" | "2.5" | "3" | "4" | "5" | "6" | "8" | "12" | "14" | "16" | "20" | "24" | "32" | "48" | "64"
pb

"0" | "auto" | "10" | "1" | "1.5" | "2" | "px" | "0.5" | "2.5" | "3" | "4" | "5" | "6" | "8" | "12" | "14" | "16" | "20" | "24" | "32" | "48" | "64"
pl

"0" | "auto" | "10" | "1" | "1.5" | "2" | "px" | "0.5" | "2.5" | "3" | "4" | "5" | "6" | "8" | "12" | "14" | "16" | "20" | "24" | "32" | "48" | "64"
position

"absolute" | "fixed" | "relative" | "static" | "sticky"
pr

"0" | "auto" | "10" | "1" | "1.5" | "2" | "px" | "0.5" | "2.5" | "3" | "4" | "5" | "6" | "8" | "12" | "14" | "16" | "20" | "24" | "32" | "48" | "64"
pt

"0" | "auto" | "10" | "1" | "1.5" | "2" | "px" | "0.5" | "2.5" | "3" | "4" | "5" | "6" | "8" | "12" | "14" | "16" | "20" | "24" | "32" | "48" | "64"
px

"0" | "auto" | "10" | "1" | "1.5" | "2" | "px" | "0.5" | "2.5" | "3" | "4" | "5" | "6" | "8" | "12" | "14" | "16" | "20" | "24" | "32" | "48" | "64"
py

"0" | "auto" | "10" | "1" | "1.5" | "2" | "px" | "0.5" | "2.5" | "3" | "4" | "5" | "6" | "8" | "12" | "14" | "16" | "20" | "24" | "32" | "48" | "64"
radius

boolean | "none" | "full" | "sm" | "lg" | "md" | "xl" | "2xl" | "3xl"
rowGap

"0" | "10" | "1" | "1.5" | "2" | "px" | "0.5" | "2.5" | "3" | "4" | "5" | "6" | "8" | "12" | "14" | "16" | "20" | "24" | "32" | "48" | "64"
textAlign

"center" | "left" | "right" | "justify"
textTransform

"lowercase" | "uppercase" | "capitalize" | "normal-case"
visible

boolean
width

WidthBase
zIndex

"auto" | "modal"