Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@paprika/button-group

Package Overview
Dependencies
Maintainers
3
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paprika/button-group

ButtonGroup component is a segmented group of toggle buttons.

  • 1.0.31
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
768
decreased by-17.6%
Maintainers
3
Weekly downloads
 
Created
Source

@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.LARGE]falseButtonGroup.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
value[string,number]true-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>
  );
};
  • Storybook Showcase
  • GitHub source code
  • Create GitHub issue
  • CHANGELOG

FAQs

Package last updated on 22 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc