Skip to main content

Base Props

The following are a handful of standard base props many components consume. For a complete list of available components and the props they consume, please see our complete API Reference.

Transition Object

A transition object defines the animatable CSS properties for three states: from, enter, and leave. From is the starting transition. Enter are the styles applied when the slide is in view. Leave are the styles when the slide goes out of view.

An example transition object looks like:

const transition = {
from: {
opacity: 0,
transform: 'rotate(45deg)'
},
enter: {
opacity: 1,
transform: 'rotate(0)'
},
leave: {
opacity: 0,
transform: 'rotate(315deg)'
}
};

Background

Background props used by Slide.

NamePropTypeDescriptionExample
backgroundImagePropTypes.stringSet CSS backgroundImageurl('...') or require(...)
backgroundSizePropTypes.stringSet CSS backgroundSizecover
backgroundPositionPropTypes.stringSet CSS backgroundPositioncenter
backgroundRepeatPropTypes.stringSet CSS backgroundRepeatno-repeat

Color

Color props are used by CodeSpan, Text, Link, Heading, Quote, Table, TableHeader, TableBody, TableRow, TableCell, UnorderedList, OrderedList, and ListItem.

NamePropTypeDescriptionExample
colorPropTypes.stringSet CSS color value or color theme value#abc123 or primary
bg or backgroundColorPropTypes.stringSet CSS background-color value or color theme value#abc123 or secondary

Space

Space props used by Box, FlexBox, Grid, CodeSpan, Text, Link, Heading, Quote, Table, TableHeader, TableBody, TableRow, TableCell, UnorderedList, OrderedList, and ListItem.

NamePropTypeDescriptionExample
m or marginPropTypes.stringSet CSS margin value or space theme value24px, 6px 3px 2px, or primary
mt or marginTopPropTypes.stringSet CSS margin-top value or space theme value1em or tertiary
mr or marginRightPropTypes.stringSet CSS margin-right value or space theme value0.5em or secondary
mb or marginBottomPropTypes.stringSet CSS margin-bottom value or space theme value2px or primary
ml or marginLeftPropTypes.stringSet CSS margin-left value or space theme value3% or secondary
mx or marginXPropTypes.stringSet CSS margin-left and margin-right value or space theme value1em or secondary
my or marginYPropTypes.stringSet CSS margin-top and margin-bottom value or space theme value5px or tertiary
p or paddingPropTypes.stringSet CSS padding value or space theme value24px, 6px 3px 2px, or primary
pt or paddingTopPropTypes.stringSet CSS padding-top value or space theme value1em or tertiary
pr or paddingRightPropTypes.stringSet CSS padding-right value or space theme value0.5em or secondary
pb or paddingBottomPropTypes.stringSet CSS padding-bottom value or space theme value2px or primary
pl or paddingLeftPropTypes.stringSet CSS padding-left value or space theme value3% or secondary
px or paddingXPropTypes.stringSet CSS padding-left and padding-right value or space theme value1em or secondary
py or paddingYPropTypes.stringSet CSS padding-top and padding-bottom value or space theme value5px or tertiary

Typography

Typography props are used by CodeSpan, Text, Link, Heading, Quote, Table, TableHeader, TableBody, TableRow, TableCell, UnorderedList, OrderedList, and ListItem.

NamePropTypeDescriptionExample
fontFamilyPropTypes.stringSet CSS font-family value or fonts theme valueHelvetica or primary
fontSizePropTypes.stringSet CSS font-size value or fontSizes theme value16px or bodyCopy
fontWeightPropTypes.stringSet CSS font-weight value or fontWeights theme value400, bold, or Heading
lineHeightPropTypes.stringSet CSS line-height value or fontWeights theme value1.5em or paragraph
letterSpacingPropTypes.stringSet CSS letter-spacing value or letterSpacings theme value1px or spreadOutText
textAlignPropTypes.stringSet CSS text-align valueleft
fontStylePropTypes.stringSet CSS font-style valuenormal or italic

Layout

Layout props are used by Box, FlexBox, Grid, Table, TableHeader, TableBody, TableRow, TableCell, CodePane, and Markdown.

NamePropTypeDescriptionExample
widthPropTypes.string or PropTypes.numberSet CSS width value or sizes theme value, fractional numeric values get converted to percents, for example 1/2 becomes 50%, whole numbers get converted into pixels100%, 1/2, 30px, 256, or primary
heightPropTypes.string or PropTypes.numberSet CSS height value or sizes theme value, fractional numeric values get converted to percents, for example 1/2 becomes 50%, whole numbers get converted into pixels100%, 1/2, 30px, 256, or primary
minWidthPropTypes.string or PropTypes.numberSet CSS min-width value or sizes theme value, fractional numeric values get converted to percents, for example 1/2 becomes 50%, whole numbers get converted into pixels100%, 1/2, 30px, 256, or primary
maxWidthPropTypes.string or PropTypes.numberSet CSS max-width value or sizes theme value, fractional numeric values get converted to percents, for example 1/2 becomes 50%, whole numbers get converted into pixels100%, 1/2, 30px, 256, or primary
minHeightPropTypes.string or PropTypes.numberSet CSS min-height value or sizes theme value, fractional numeric values get converted to percents, for example 1/2 becomes 50%, whole numbers get converted into pixels100%, 1/2, 30px, 256, or primary
maxHeightPropTypes.string or PropTypes.numberSet CSS max-height value or sizes theme value, fractional numeric values get converted to percents, for example 1/2 becomes 50%, whole numbers get converted into pixels100%, 1/2, 30px, 256, or primary
sizePropTypes.string or PropTypes.numberSet CSS width and height value or sizes theme value, fractional numeric values get converted to percents, for example 1/2 becomes 50%, whole numbers get converted into pixels100%, 1/2, 30px, 256, or primary
displayPropTypes.stringSet CSS display valueinline-block
overflowPropTypes.stringSet CSS overflow valuevisible
overflowXPropTypes.stringSet CSS overflow-x valuehidden
overflowYPropTypes.stringSet CSS overflow-y valuevisible

Flex

Flex props are used by FlexBox.

NamePropTypeDescriptionExample
alignItemsPropTypes.stringSet CSS align-items valueflex-start
alignContentPropTypes.stringSet CSS align-content valuecenter
justifyContentPropTypes.stringSet CSS justify-content valuespace-between
flexWrapPropTypes.stringSet CSS flex-wrap valuewrap
flexBasisPropTypes.string or PropTypes.numberSet CSS flex-basis valueauto or 1
flexDirectionPropTypes.stringSet CSS flex-direction valuecolumn
flexPropTypes.stringSet CSS flex value1 1 auto
justifySelfPropTypes.stringSet CSS justify-self valuestretch
alignSelfPropTypes.stringSet CSS align-self valuecenter
orderPropTypes.numberSet CSS order value1

Grid

Grid props are used by Grid.

NamePropTypeDescriptionExample
gridGapPropTypes.numberSet CSS grid-gap value15
gridColumnGapPropTypes.numberSet CSS grid-column-gap value3
gridRowGapPropTypes.numberSet CSS grid-row-gap value6
gridColumnPropTypes.number or PropTypes.stringSet CSS grid-column valueauto, 1 / 2, or 3
gridRowPropTypes.number or PropTypes.stringSet CSS grid-row valueauto, 1 / 2, or 3
gridAutoFlowPropTypes.stringSet CSS grid-auto-flow valuerow or column-dense
gridAutoColumnsPropTypes.stringSet CSS grid-auto-columns valuemin-content, 1fr, or minmax(10px, auto)
gridAutoRowsPropTypes.stringSet CSS grid-auto-rows valuemin-content, 1fr, or minmax(10px, auto)
gridTemplateColumnsPropTypes.stringSet CSS grid-template-columns value60px 60px or 1fr 2fr
gridTemplateRowsPropTypes.stringSet CSS grid-template-rows value40px 1fr or 8ch auto
gridTemplateAreasPropTypes.stringSet CSS grid-template-area valuea b or inherit
gridAreaPropTypes.stringSet CSS grid-area valuea or 2 / 1 / 4

Position

Position props are used by Box, FlexBox, Grid, CodePane, FullScreen, Progress, AnimatedProgress, and Markdown.

NamePropTypeDescriptionExample
positionPropTypes.stringSet CSS position valuerelative
zIndexPropTypes.numberSet CSS z-index value2
topPropTypes.numberSet CSS top value1
rightPropTypes.numberSet CSS right value3
bottomPropTypes.numberSet CSS bottom value10
leftPropTypes.numberSet CSS left value5

Border

Border props are used by Box, FlexBox, Grid, Table, TableHeader, TableBody, TableRow, and TableCell.

NamePropTypeDescriptionExample
borderPropTypes.stringSet CSS position value2px solid white
borderWidthPropTypes.number or PropTypes.stringSet CSS border-width value5px
borderStylePropTypes.stringSet CSS border-style valuesolid
borderColorPropTypes.stringSet CSS border-color valuergb(255, 200, 150)
borderRadiusPropTypes.number or PropTypes.stringSet CSS border-radius value10
borderTopPropTypes.stringSet CSS border-top value3px dashed #000
borderTopWidthPropTypes.number or PropTypes.stringSet CSS border-top-width value1
borderTopStylePropTypes.stringSet CSS border-top-style valuesolid
borderTopColorPropTypes.stringSet CSS border-top-color value#ff0abc
borderTopLeftRadiusPropTypes.number or PropTypes.stringSet CSS border-top-left-radius value20%
borderTopRightRadiusPropTypes.number or PropTypes.stringSet CSS border-top-right-radius value4px
borderRightPropTypes.stringSet CSS border-right valuerelative
borderRightWidthPropTypes.number or PropTypes.stringSet CSS border-right-width value1px
borderRightStylePropTypes.stringSet CSS border-right-style valuesolid
borderRightColorPropTypes.stringSet CSS border-right-color valuered
borderBottomPropTypes.stringSet CSS border-bottom value2px solid blue
borderBottomWidthPropTypes.number or PropTypes.stringSet CSS border-bottom-width value1em
borderBottomStylePropTypes.stringSet CSS border-bottom-style valuedashed
borderBottomColorPropTypes.stringSet CSS border-bottom-color valueorange
borderBottomLeftRadiusPropTypes.number or PropTypes.stringSet CSS border-bottom-left-radius value2px
borderBottomRightRadiusPropTypes.number or PropTypes.stringSet CSS border-bottom-right-radius value4px
borderLeftPropTypes.stringSet CSS border-left value1px solid green
borderLeftWidthPropTypes.number or PropTypes.stringSet CSS border-left-width value2px
borderLeftStylePropTypes.stringSet CSS border-left-style valuesolid
borderLeftColorPropTypes.stringSet CSS border-left-color valuegreen
borderXPropTypes.stringSet CSS border-left and border-right value2px dotted red
borderYPropTypes.stringSet CSS border-top and border-bottom value1px solid black