1.0.31 • Published 2 years ago

@paprika/button-group v1.0.31

Weekly downloads
302
License
MIT
Repository
github
Last release
2 years ago

@paprika/button-group

Description

ButtonGroup component is a segmented group of toggle buttons.

Installation

yarn add @paprika/button-group

or with npm:

npm install @paprika/button-group

Props

ButtonGroup

PropTyperequireddefaultDescription
childrennodefalsenullThe toggle buttons in the group.
hasIconsboolfalsefalseTo show the icons used for selected / not selected.
isDisabledboolfalsefalseIf the entire button group is disabled.
isFullWidthboolfalsefalseIf the width of the button group should stretch to fit its parent container (100%).
isMultiboolfalsefalseIf multiple simultaneous selections are allowed.
isSemanticboolfalsetrueIf it will be rendered as a button element. If false, a span will be rendered via an accessible RawButton.
onChangefuncfalse() => {}Callback to be executed when any button item is clicked or activated by keyboard. It will return an array of the selected items' "value" properties.
size ButtonGroup.types.size.SMALL, ButtonGroup.types.size.MEDIUM, ButtonGroup.types.size.LARGEfalseButtonGroup.types.size.MEDIUMSize of the buttons (height, font size, etc).

ButtonGroup.Item

PropTyperequireddefaultDescription
childrennodefalsenullContent label of the button to be displayed.
defaultIsActiveboolfalsefalseIf the item is active or on selected state
valuestring,numbertrue-Unique key to represent the selected value.

Usage

import ButtonGroup from "@paprika/button-group";

const yourComponent = () => {
  const handleChange = selectedValues => {
    // do something with array of selected values
  };

  return (
    <ButtonGroup onChange={handleChange}>
      <ButtonGroup.Item value={1} defaultIsSelected>
        One
      </ButtonGroup.Item>
      <ButtonGroup.Item value={2}>Two</ButtonGroup.Item>
      <ButtonGroup.Item value={3}>Three</ButtonGroup.Item>
    </ButtonGroup>
  );
};

Links

1.0.31

2 years ago

1.0.31-next.0

2 years ago

1.0.30

2 years ago

1.0.30-next.0

2 years ago

1.0.30-next.1

2 years ago

1.0.29

3 years ago

1.0.28

3 years ago

1.0.29-next.0

3 years ago

1.0.28-next.0

3 years ago

1.0.26

3 years ago

1.0.27

3 years ago

1.0.26-next.0

3 years ago

1.0.27-next.0

3 years ago

1.0.26-next.1

3 years ago

1.0.25

3 years ago

1.0.25-next.2

3 years ago

1.0.25-next.1

3 years ago

1.0.25-next.0

3 years ago

1.0.24

3 years ago

1.0.23

4 years ago

1.0.24-next.0

3 years ago

1.0.24-next.1

3 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.21-next.4

4 years ago

1.0.21-next.3

4 years ago

1.0.21-next.2

4 years ago

1.0.21-next.1

4 years ago

1.0.21-next.0

4 years ago

1.0.22-next.0

4 years ago

1.0.23-next.0

4 years ago

1.0.19

4 years ago

1.0.19-next.0

4 years ago

1.0.20-next.0

4 years ago

1.0.20

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.18-next.0

4 years ago

1.0.17-next.0

4 years ago

1.0.16

4 years ago

1.0.16-next.0

4 years ago

1.0.15

4 years ago

1.0.15-next.0

4 years ago

1.0.14-next.0

4 years ago

1.0.14

4 years ago

1.0.13-next.0

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.12-next.0

4 years ago

1.0.11-next.0

4 years ago

1.0.11

4 years ago

1.0.9

4 years ago

1.0.10-next.0

4 years ago

1.0.9-next.0

4 years ago

1.0.9-next.1

4 years ago

1.0.10

4 years ago

1.0.8

4 years ago

1.0.8-alpha.2

4 years ago

1.0.8-alpha.0

4 years ago

1.0.8-alpha.1

4 years ago

1.0.7

4 years ago

1.0.7-alpha.0

4 years ago

1.0.6-alpha.0

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.5-alpha.0

4 years ago

1.0.4

4 years ago

1.0.4-alpha.0

4 years ago

1.0.3

5 years ago

1.0.3-alpha.1

5 years ago

1.0.3-alpha.0

5 years ago

1.0.2

5 years ago

1.0.2-alpha.1

5 years ago

1.0.2-alpha.0

5 years ago

1.0.1

5 years ago

1.0.1-alpha.1

5 years ago

1.0.1-alpha.0

5 years ago

1.0.0

5 years ago

0.1.20

5 years ago

0.1.20-alpha.4

5 years ago

0.1.20-alpha.3

5 years ago

0.1.20-alpha.2

5 years ago

0.1.20-alpha.1

5 years ago

0.1.20-alpha.0

5 years ago

0.1.19

5 years ago

0.1.18

5 years ago

0.1.17

5 years ago

0.1.16

5 years ago

0.1.15

5 years ago

0.1.14

5 years ago

0.1.13

5 years ago

0.1.12

5 years ago

0.1.11

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago