Socket
Socket
Sign inDemoInstall

@times-tooling/button-set

Package Overview
Dependencies
26
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @times-tooling/button-set

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


Version published
Maintainers
1
Created

Readme

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

Last updated on 26 Jun 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc