3.1.0 • Published 1 year ago

@wedgekit/button v3.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

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'.

3.1.0

1 year ago

3.0.2

1 year ago

3.0.1

1 year ago

3.1.0-tc.1

2 years ago

3.1.0-tc.0

2 years ago

3.0.0-tc.3

2 years ago

3.0.0-tc.4

2 years ago

3.0.0-tc.1

2 years ago

3.0.0-tc.2

2 years ago

3.0.0

2 years ago

3.0.1-tc.10

2 years ago

3.0.1-tc.1

2 years ago

3.0.1-tc.0

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

3 years ago

1.5.0

3 years ago

1.4.5

3 years ago

1.4.4

3 years ago

1.4.3

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.1-tc1

3 years ago

1.4.1-tc0

3 years ago

1.4.0

3 years ago

1.4.0-tc.1

3 years ago

1.4.0-tc.2

3 years ago

1.4.0-tc.3

3 years ago

1.3.2-tc.6

3 years ago

1.3.2-tc.7

3 years ago

1.3.3

3 years ago

1.3.2-tc.4

3 years ago

1.3.2-tc.5

3 years ago

1.3.2

3 years ago

1.3.2-tc.1

3 years ago

1.3.2-tc.2

3 years ago

1.3.2-tc.3

3 years ago

1.3.1-tc.5

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

1.0.0-tc.o

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago

0.0.0

3 years ago