Button

The Button component builds on the Paper, Color and Container components for the root component, and use Typography component inside.

Props

Props of the Paper | Color | Container components are also available.
NameTypeDefaultDescription
children or labelnodeThe content of the component.
secondaryTextnodeText on the second line
Componentelement typehref ? 'a' : 'button'The component used for the root node. Either a string to use a HTML element or a component.
variantstring - inline, text, contained, outlinedcontainedThe variant to use.
sizestring - none, small, default, large, inlinedefaultSet border-radius and padding from presets were specified in the theme. The component passes this property to the Typography component as a variant prefixed with "button-".
disabledboolfalseIf true, the component is disabled.
disableElevationboolvariant === 'text'If true, no elevation is used.
startIconnodeStart icon children placed before the children or label.
endIconnodeEnd icon children placed after the children or label.
startIconSeparatorboolfalseAdd separator after the start icon
endIconSeparatorboolfalseAdd separator before the end icon
iconnodeIcon children. Can only be used if children or label and startIcon and endIcon are not specified.
onlyIconboolForce icon button
circleboolfalsemakes a circle out of the button, usually used together with the icon.
paperVariantstringvariant === 'inline' ? 'inherit' : variantPasses these property to Paper component
TypographyComponentnodeTypographyPasses these property to Typography component what is the first container inside the root
TypographyPropsobjectnullPasses these properties to Typography component what contain the all content: children and icons
LabelComponentnodevariant === 'inline' ? 'span' : 'div'Passes these property to label component what contain children or label
classesobject {container:'', content:'', startIcon:'', endIcon:'', icon:'', 'label', 'labelWidthSecondaryText'}Adds these classNames to the corresponding element
ButtonBaseContentComponentnodeThe component changed full content of the button
tipnode(_onlyIcon && (label II children)) II ''If specified the tooltip show up
The ref is forwarded to the root Paper component.

Examples

Buttons with contained variant
Disabled buttons with contained variant
Buttons with outlined variant
Disabled buttons with outlined variant
Buttons with text variant
Disabled buttons with text variant
Inline buttons

Inline buttons inheriting the Paper color as all other components, but the inline buttons inheriting the Paper variant too.

Like this with primary color and contained variant of the parent paper

These setups are .

Default paper with inline

Paper 1 with inline

Paper 2 with inline

Inline on Paper with Success color and contained variant

Inline on Paper with Success color and text variant

Inline on Paper with Success color and contained variant

Inline on Paper with Success color and text variant

Inline on Paper with Success color and contained variant

Inline on Paper with Success color and text variant

Example for disableElevation
Example for sizes
Button variants with startIcon and endIcon
Start icon and end icon with separator: endIconSeparator = true or startIconSeparator = true
Buttons fullWidth
Variants of icon buttons
Icon buttons with circle