Skip to content

Button

Buttons provide a clickable element, which can be used in forms, or anywhere that needs simple, standard button functionality. They may display text, icons, or both.

Examples

Basic Usage

js
<Mdx-button>Default</Mdx-button>
<Mdx-button disabled="true">Default</Mdx-button>

Expand

This property lets you specify how wide the button should be. By default, buttons have display: inline-block, but setting this property will change the button to a full-width element with display: block.

js
<Mdx-button expand="block">Block</Mdx-button>
<Mdx-button expand="full">Full</Mdx-button>

Fill

This property determines the background and border color of the button.

js
<Mdx-button>Default</Mdx-button>
<Mdx-button fill="clear">Clear</Mdx-button>
<Mdx-button fill="outline">Outline</Mdx-button>
<Mdx-button fill="solid">Solid</Mdx-button>

Size

This property specifies the size of the button. Setting this property will change the height and padding of a button.

js
<Mdx-button size="small">Small</Mdx-button>
<Mdx-button size="default">Default</Mdx-button>

Icons

js
<Mdx-button icon="icon">Icon</Mdx-button>

Colors

js
<Mdx-button>Default</Mdx-button>
<Mdx-button color="primary">Primary</Mdx-button>
<Mdx-button color="secondary">Secondary</Mdx-button>
<Mdx-button color="tertiary">Tertiary</Mdx-button>
<Mdx-button color="success">Success</Mdx-button>
<Mdx-button color="warning">Warning</Mdx-button>
<Mdx-button color="danger">Danger</Mdx-button>
<Mdx-button color="light">Light</Mdx-button>
<Mdx-button color="medium">Medium</Mdx-button>
<Mdx-button color="dark">Dark</Mdx-button>

Properties

color

DescriptionThe color to use from your application's color palette (ionic variables)
Type"primary" | "secondary" | "tertiary" | "dange" | "warning" | "success" | "light" | "medium" | "dark" |
Requiredprimary

fill

DescriptionSet to "outline" for a transparent button with a border, or to "solid" for a button with a filled background. The default fill is "solid"
Type"solid" | "outline"
Defaultsolid

size

DescriptionChange the size of the button
Type"default" | "small
Defaultdefault

expand

DescriptionSet to "block" for a full-width button or to "full" for a full-width button with square corners and no left or right borders
Type"block" | "full" | undefined
Defaultundefined

disabled

DescriptionIf true, the user cannot interact with the button`
TypeBoolean
Defaultfalse

loading

DescriptionIf true, the loading indicator will show and user cannot interact with the button`
TypeString
Defaultkey

icon

DescriptionAllows you to send icon as prop to the button
Type"String" | "null"
Defaultnull