Hooks based ladda buttons port in typescript with hooks
This is a port of Ladda by Hakim El Hattab
npm install --save react-ladda-button
import React, { Component } from 'react'
import LaddaButton, {EXPAND_LEFT} from 'react-ladda-button'
import 'react-ladda-button/dist/ladda-themeless.min.css'
class Example extends Component {
render() {
return <LaddaButton data-style={EXPAND_LEFT}>I'm a button!</LaddaButton>
}
}
More examples in the Live Demo. The API is virtually identical to Ladda.
The spinner style attributes are only used on first spinner creation, then the spinner is cached. This seems like something that likely never changes. If you need these to change, use a key to force the button to get recreated. This isn't an oversight its a conscious choice.
MIT © RickeyWard
this library was bootstrapped with create-react-library and yarn
yarn start
then in another terminal
cd example && yarn start