import * as React from "react"; import * as System from "~/components/system"; import SystemPage from "~/components/system/SystemPage"; import ViewSourceLink from "~/components/system/ViewSourceLink"; import CodeBlock from "~/components/system/CodeBlock"; import Group from "~/components/system/Group"; export default class SystemPageButtons extends React.Component { render() { return ( Buttons

The Button component is used to trigger an action or event, such as submitting a form or saving users information.


Imports

Import React and the Button Components.

{`import * as React from "react"; import { ButtonPrimary, ButtonSecondary, ButtonTertiary, ButtonDisabled, ButtonWarning, } from "slate-react-system";`}

Regular width

There are five variations of the button component.
Primary, Secondary, Tertiary, Disabled, and Warning.

Primary   Secondary   Tertiary   Disabled   Warning

{`class ExamplePrimary extends React.Component { render() { return Primary Button; } } class ExampleSecondary extends React.Component { render() { return Secondary Button; } } class ExampleTertiary extends React.Component { render() { return Tertiary Button; } } class ExampleDisabled extends React.Component { render() { return Disabled Button; } } class ExampleWarning extends React.Component { render() { return Warning Button; } }`}


Full width

Each of the button styles has a full width option.
Primary button full

Secondary button full

Tertiary button full

Disabled button full

Warning button full


{`class ExamplePrimaryFull extends React.Component { render() { return Primary button full; } } class ExampleSecondaryFull extends React.Component { render() { return Secondary button full; } } class ExampleTertiaryFull extends React.Component { render() { return Tertiary button full; } } class ExampleDisabledFull extends React.Component { render() { return Disabled button full; } } class ExampleWarningFull extends React.Component { render() { return Warning button full; } }`}


Labels

You can add the type='label' property to convert any of the above buttons into a label.
Primary label   Secondary label   Tertiary label   Disabled label  

Warning label

{`class ExamplePrimaryLabel extends React.Component { render() { return Primary Button Label; } } class ExampleSecondaryLabel extends React.Component { render() { return ( Secondary Button Label ); } } class ExampleTertiaryLabel extends React.Component { render() { return ( Tertiary Button Label ); } } class ExampleDisabledLabel extends React.Component { render() { return Disabled Button Label; } } class ExampleWarningLabel extends React.Component { render() { return Warning Button Label; } }`}


Accepted React Properties

); } }