Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

react-utils-button

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-utils-button

Lightweight React Button component, serving as a reusable utility wrapper over the HTML button element.

latest
Source
npmnpm
Version
1.3.1
Version published
Maintainers
1
Created
Source

React Utils Button Build Status

Lightweight React Button component, serving as an utility wrapper over the HTML button element.

Demo: https://raulrene.github.io/react-utils-button/example/

Installation

npm i --save react-utils-button

Usage

import Button from 'react-utils-button';

<Button value='Click me'
		className='my-extra-class'
		onClick={() => { console.log('clicked'); }}
		active={false}
		loading={false}
		disabled={false}/>

The library can also be loaded via require:

const Button = require('react-utils-button');

Options

  • value (string, required) - value to be displayed inside the button
  • className (string) - extra classes
  • onClick (function) - callback function
  • active (boolean, default: false) - force active state; adds a utils-button--active class
  • disabled (boolean, default: false) - disabled state for the button; once disabled the onClick callback does not fire anymore
  • loading (boolean, default: false) - sets a loading state, also automatically making it disabled; adds a utils-button--loading class. This can be used to style a loading state, for example a spinner to let the user know something is happening.

Licence

The code is open-source and available under the MIT Licence. More details in the LICENCE.md file.

Keywords

react-utils-button

FAQs

Package last updated on 04 Mar 2019

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