Socket
Book a DemoInstallSign in
Socket

@times-tooling/button-set

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@times-tooling/button-set

``` yarn add @times-tooling/button-set ```

4.0.0
latest
npmnpm
Version published
Weekly downloads
11
-54.17%
Maintainers
1
Weekly downloads
 
Created
Source

How to use

yarn add @times-tooling/button-set
import ButtonSet from '@times-tooling/button-set'
import { faRocket, faEdit, faSquare } from '@fortawesome/free-solid-svg-icons';

<ButtonSet
    onChange={() => {}}
    value={''}
    name="button-set"
    buttons={[
        { value: 'value', title: 'Click A', icon: faRocket },
        { value: 'value', title: 'Click B', icon: faEdit },
        { value: 'value', title: 'Click C', icon: faSquare },
    ]}
/>

Props

onChange

Fired when the user clicks a button in the set. It should update value in the parent state.

value

The selected button in the set that has a matching value prop

name

The name of the input element

buttons

An array of button configuration objects that have value, title, and an icon

Note: when using font-awesome, you'll need to set up a library of icons in your app, as follows:

import { library } from '@fortawesome/fontawesome-svg-core';
import { faPencilAlt } from '@fortawesome/free-solid-svg-icons';

library.add(faPencilAlt);

...

<ButtonSet buttons=[{ icon: 'pencil-alt' }] />

You can also pass in a specific icon like this:

import { library } from '@fortawesome/fontawesome-svg-core';
import { faPencilAlt } from '@fortawesome/free-solid-svg-icons';

...

<ButtonSet buttons={[{ icon: faPencilAlt }]} />

Development

yarn build
yarn test

FAQs

Package last updated on 26 Jun 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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.