For Developers
Style Props
Style props provide a common, ergonomic API for modifying a component's styles by passing styles with props.
System Prop Values
Many style props are design-system-aware and translate SystemPropValues
for you automatically. In
the example below, the padding
prop translates the value s
to 16px
and frenchVanilla100
to
#ffffff
. These SystemPropValues
are also included in our types, so your IDE's intellisense
should suggest these values as you work. This allows you to use Canvas design tokens fluidly without
disrupting your workflow.
<Box padding="s" backgroundColor="frenchVanilla100">Hello, style props!</Box>
There are seven types of system prop values: color
, depth
, font
, fontSize
, fontWeight
,
shape
, and space
— corresponding to our Canvas design tokens. Each style prop section below
includes a table. The "System" column in that table will tell you which system prop values are
supported.
Background
Background style props allow you to adjust the background styles of components.
Prop | CSS Properties | System |
---|---|---|
background | color | |
backgroundAttachment | --- | |
backgroundColor | color | |
backgroundImage | --- | |
backgroundPosition | --- | |
backgroundRepeat | --- | |
backgroundSize | --- |
Border
Border style props allow you to adjust the border styles of components.
Prop | CSS Properties | System |
---|---|---|
border | --- | |
borderBottom | --- | |
borderBottomColor | color | |
borderBottomLeftRadius | shape | |
borderBottomRightRadius | shape | |
borderBottomStyle | --- | |
borderBottomWidth | --- | |
borderCollapse | --- | |
borderColor | color | |
borderInlineEnd | --- | |
borderInlineEndColor | color | |
borderInlineEndStyle | --- | |
borderInlineEndWidth | --- | |
borderInlineStart | --- | |
borderInlineStartColor | color | |
borderInlineStartStyle | --- | |
borderInlineStartWidth | --- | |
borderLeft | --- | |
borderLeftColor | color | |
borderLeftStyle | --- | |
borderLeftWidth | --- | |
borderRadius | shape | |
borderRight | --- | |
borderRightColor | color | |
borderRightStyle | --- | |
borderRightWidth | --- | |
borderSpacing | --- | |
borderStyle | --- | |
borderTop | --- | |
borderTopColor | color | |
borderTopLeftRadius | shape | |
borderTopRightRadius | shape | |
borderTopStyle | --- | |
borderTopWidth | --- | |
borderWidth | --- |
Color
Color style props allow you to adjust the color styles of components.
Prop | CSS Properties | System |
---|---|---|
backgroundColor | color | |
color | color | |
opacity | --- |
Depth
Depth style props allow you to adjust the depth styles of components.
Prop | CSS Properties | System |
---|---|---|
boxShadow | --- | |
depth | depth |
Flex
Flex style props allow you to adjust the flex styles of components.
Prop | CSS Properties | System |
---|---|---|
alignContent | --- | |
alignItems | --- | |
columnGap | space | |
display | --- | |
flexDirection | --- | |
flexWrap | --- | |
gap | space | |
justifyContent | --- | |
justifyItems | --- | |
rowGap | space |
Flex Item
Flex item style props allow you to adjust the flex item styles of components.
Prop | CSS Properties | System |
---|---|---|
alignSelf | --- | |
flex | --- | |
flexBasis | --- | |
flexGrow | --- | |
flexShrink | --- | |
justifySelf | --- | |
order | --- |
Grid
Grid style props allow you to adjust the grid styles of components.
Prop | CSS Properties | System |
---|---|---|
alignContent | --- | |
alignItems | --- | |
display | --- | |
grid | --- | |
gridArea | --- | |
gridAutoColumns | --- | |
gridAutoFlow | --- | |
gridAutoRows | --- | |
gridColumnGap | space | |
gridGap | space | |
gridPlaceItems | --- | |
gridRowGap | space | |
gridTemplate | --- | |
gridTemplateAreas | --- | |
gridTemplateColumns | --- | |
gridTemplateRows | --- | |
justifyContent | --- | |
justifyItems | --- |
Grid Item
Grid item style props allow you to adjust the grid item styles of components.
Prop | CSS Properties | System |
---|---|---|
alignSelf | --- | |
gridArea | --- | |
gridColumn | --- | |
gridColumnEnd | --- | |
gridColumnStart | --- | |
gridRow | --- | |
gridRowEnd | --- | |
gridRowStart | --- | |
justifySelf | --- | |
placeSelf | --- |
Layout
Layout style props allow you to adjust the layout styles of components.
Prop | CSS Properties | System |
---|---|---|
display | --- | |
height | space | |
listStyle | --- | |
maxHeight | space | |
maxWidth | space | |
minHeight | space | |
minWidth | space | |
overflow | --- | |
overflowX | --- | |
overflowY | --- | |
verticalAlign | --- | |
width | space |
Other
Other style props allow you to adjust the other, miscellaneous styles of components.
Prop | CSS Properties | System |
---|---|---|
animation | --- | |
appearance | --- | |
boxSizing | --- | |
content | --- | |
cursor | --- | |
fill | --- | |
float | --- | |
objectFit | --- | |
objectPosition | --- | |
outline | --- | |
outlineOffset | --- | |
overflowWrap | --- | |
pointerEvents | --- | |
resize | --- | |
stroke | --- | |
transform | --- | |
transition | --- | |
userSelect | --- | |
visibility | --- |
Position
Position style props allow you to adjust the position styles of components.
Prop | CSS Properties | System |
---|---|---|
bottom | --- | |
insetInlineEnd | --- | |
insetInlineStart | --- | |
left | --- | |
position | --- | |
right | --- | |
top | --- | |
zIndex | --- |
Space
Space style props allow you to adjust the space styles of components.
Prop | CSS Properties | System |
---|---|---|
margin | space | |
marginBottom | space | |
marginInlineEnd | space | |
marginInlineStart | space | |
marginLeft | space | |
marginRight | space | |
marginTop | space | |
marginX | space | |
marginY | space | |
padding | space | |
paddingBottom | space | |
paddingInlineEnd | space | |
paddingInlineStart | space | |
paddingLeft | space | |
paddingRight | space | |
paddingTop | space | |
paddingX | space | |
paddingY | space |
Text
Text style props allow you to adjust the text styles of components.
The Elements of Typographic Style
"Typography is the craft of endowing human language with a durable visual form."
― Robert BringhurstProp | CSS Properties | System |
---|---|---|
fontFamily | font | |
fontSize | fontSize | |
fontStyle | --- | |
fontWeight | fontWeight | |
letterSpacing | --- | |
lineHeight | --- | |
textAlign | --- | |
textDecoration | --- | |
textOverflow | --- | |
textShadow | --- | |
textTransform | --- | |
whiteSpace | --- | |
wordBreak | --- |
Can't Find What You Need?
Check out our FAQ section which may help you find the information you're looking for.
FAQ Section