1.3.8 • Published 3 years ago

@vtex-components/button v1.3.8

Weekly downloads
51
License
-
Repository
github
Last release
3 years ago

VTEX Components Button

Elementary accessible button component that can be reused by all VTEX Styleguides. You can use reakit full features (except the 'as' prop) and theme-ui's sx. It renders a button element by default.

This is a styled base component, so any Styleguide can theme it. You may configure your components.button property of the theme object (check the theming section).

Install

yarn add @vtex-components/button

or

npm install @vtex-components/button

Usage

import Button from '@vtex-components/button'

function UseCase() {
  return <Button>VTEX Components Button</Button>
}

🎨 Theming

ModifierDescription
stylesbase styles
variantbutton variants
sizemeasures in general

Example

You can define the theme with:

const theme = {
  components: {
    button: {
      styles: {
        ':focus': {
          outline: 'none',
          boxShadow: '0px 0px 1px 0px solid #cecece'
        }
      },
      variant: {
        primary: {
          bg: 'primary',
          color: 'white',
        },
        secondary: {
          bg: 'secondary',
          color: 'black',
        },
      },
      size: {
        small: {
          paddingY: 1
          paddingX: 2
        },
        regular: {
          paddingY: 2
          paddingX: 3
        },
      },
    },
  },
}

Then use the Button:

<Button variant="primary" size="small">
  Small Primary Button
</Button>
1.3.8

3 years ago

1.3.7

3 years ago

1.3.6

3 years ago

1.3.5

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

4 years ago

1.3.1-alpha.0

4 years ago

1.3.0

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.1-alpha.11

4 years ago

1.1.1-alpha.10

4 years ago

1.1.1-alpha.9

4 years ago

1.1.1-alpha.7

4 years ago

1.1.1-alpha.6

4 years ago

1.1.1-alpha.4

4 years ago

1.1.1-alpha.5

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.1-beta.0

4 years ago

1.0.0

4 years ago