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

@paprika/button-group

Package Overview
Dependencies
Maintainers
4
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.

  • 0.1.14
  • Source
  • npm
  • Socket score

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

@paprika/button-group - 0.1.14

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
  • Github create issue
  • ChangeLog

FAQs

Package last updated on 04 Sep 2020

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