@wedgekit/button
TypeScript icon, indicating that this package has built-in type declarations

3.1.0 • Public • Published

Button

Purpose

The Button component is a styled HTML button.

Basic Implementation

import Button from '@wedgekit/button';

const Example = () => {
  const [domain, setDomain] = React.useState('primary');

  return (
    <div>
      <Button
        domain={domain}
        onClick={() => setDomain(domain === 'primary' ? 'secondary' : 'primary')}
      >
        Click Me
      </Button>
    </div>
  );
};

render(<Example />);

Props

In addition to the props listed below, all native and React HTML attributes will be passed through.

children

Type: string

Required:

The string label for the button. The label should be descriptive and readable. If children is not used, an aria-label should be added for accessibility.

domain

Type: 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'default' | 'white'

Required:

A string denoting the domain of the Button. This defaults to 'default'.

fullWidth

Type: boolean

Required:

Sets the button to fill the full-width of its parent container.

icon

Type: IconTag

Required:

Optional prop to display an icon positioned left of the text. An IconTag is a snake-cased name of a provided icon. A full list can be found here

label

Type: string

Required:

A label describing the type of button. If none is provided, the child string will be used for 'aria-label'

submitting

Type: boolean

Required:

Indicates button is in a submitting state. Will display a spinner if true.

variant

Type: 'noFill' | ‘neutral’ | 'outline'

Required:

A string denoting the variant style of the Button. This defaults to 'neutral'.

Readme

Keywords

none

Package Sidebar

Install

npm i @wedgekit/button

Weekly Downloads

74

Version

3.1.0

License

MIT

Unpacked Size

30.4 kB

Total Files

21

Last publish

Collaborators

  • tprettyman
  • rnimrod
  • jquerijero
  • brent-heavican
  • msuiter
  • rerskine
  • timmy2654
  • jfiller
  • mada1113
  • kolson
  • dreadman3716