šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

@vlsergey/react-bootstrap-button-with-spinner

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vlsergey/react-bootstrap-button-with-spinner

Wrapper around React Bootstrap Button component with spinner and auto-disabled functionality (to prevent doubleclick)

2.0.0
latest
Source
npm
Version published
Maintainers
1
Created
Source

@vlsergey/react-bootstrap-button-with-spinner

Ready-to-use wrapper for react-bootstrap Button component. Automatically disables button and displays spinner inside until async onClick handler is completed. I.e. until Promise returned by onClick is resolved or rejected.

NPM version Build Status Downloads

Installation

npm i --save @vlsergey/react-bootstrap-button-with-spinner

or

npm i --save-dev @vlsergey/react-bootstrap-button-with-spinner

Usage

// Replace 'import Button from "react-bootstrap/Button"' with"
import Button from "@vlsergey/react-bootstrap-button-with-spinner"

<Button onClick={this.handleClick}>Button text</Button>

Component is a drop-in replacement for React Bootstrap Button component.

No additional configuration is required.

onClick handle does not need to be async, i.e. is not required to return Promise. But auto-disable/auto-spinner functionality will work only if handler is async. In other cases it will fallback to original functionality of Button.

Props

PropertyDefault valueDescription
spinner<Spinner animation="border" aria-hidden="true" as="span" role="status" size="sm" {...spinnerProps} />Allow to replace default Spinner with something else
spinnerProps{}Allow to override default Spinner properties.

Keywords

react

FAQs

Package last updated on 11 Aug 2021

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