@@ -4,33 +4,25 @@ This is a quick save for anyone looking to add a loading button for Bootstrap in
44
55** Note: You must install peer dependency [ bootstrap] ( https://www.npmjs.com/package/bootstrap ) and import the bootstrap stylesheet**
66
7- # v1.0.0
8-
9- ### Breaking Changes
7+ ## Links
108
11- - Removed ` buttonProps ` , you can now passed the props on the ` <ReactBootstrapButton> ` itself
12- - Renamed ` loaderPosition ` to ` spinnerPosition `
13- - Renamed ` spinnerProps ` to ` spinnerProps `
14- - Added ability to forward ` ref `
15- - Renamed ` icon ` to ` leftIcon ` (prepare for the possibility of adding a right icon )
9+ - [ Demo ] ( https://chewhx.github.io/react-bootstrap-button )
10+ - 📦 [ NPM ] ( https://www.npmjs.com/package/react-bootstrap-button )
11+ - 🗄️ [ Repo ] ( https://github.com/chewhx/react-bootstrap-button )
12+ - 🐙 [ GitHub ] ( https://github.com/chewhx )
13+ - 🖥️ [ Website ] ( https://www.chewhx.com )
1614
1715## Installation
1816
19- Install the package
17+ 1 . Install the package and bootstrap
2018
2119``` bash
22- npm install react-bootstrap-button
20+ npm install react-bootstrap-button bootstrap
2321```
2422
25- If you have not already done so, inject bootstrap styles with guides from the [ official bootstrap documentation] ( https://getbootstrap.com/docs/5.1/getting-started/introduction/ ) .
26-
27- Using npm:
28-
29- ``` bash
30- npm install bootstrap
31- ```
23+ For other installation methods of bootstrap styles, refer to guides from the [ official bootstrap documentation] ( https://getbootstrap.com/docs/5.1/getting-started/introduction/ ) .
3224
33- In your App.js:
25+ 2 . Import bootstrap stylesheet in your App.js:
3426
3527``` javascript
3628import ' ../node_modules/bootstrap/dist/css/bootstrap.min.css' ;
@@ -50,7 +42,8 @@ const Component = () => {
5042 return (
5143 < BootstrapButton
5244 variant= " danger"
53- className= " m-4"
45+ // You may include all react-bootstrap button props
46+ className= " m-4" .
5447 isLoading= {clicked}
5548 loadingMessage= " This button is loading..."
5649 onClick= {handleClick}
@@ -68,12 +61,14 @@ const Component = () => {
6861Properties for ` <BootstrapButton> ` includes those from React-Bootstrap Button and the following:
6962
7063``` typescript
71- isLoading ?: boolean ;
72- isDisabled ?: boolean ;
73- spinnerPosition ?: ' left' | ' right' ;
74- spinnerProps ?: SpinnerProps ; // see React Spinner Props Api
75- loadingMessage ?: string ;
76- leftIcon ?: ReactElement ;
64+ type BootstrapButton = {
65+ isLoading? : boolean ;
66+ isDisabled? : boolean ;
67+ spinnerPosition? : ' left' | ' right' ;
68+ spinnerProps? : SpinnerProps ; // see React Spinner Props Api
69+ loadingMessage? : string ;
70+ leftIcon? : ReactElement ;
71+ };
7772```
7873
7974- [ React-Bootstrap Button Props] ( https://react-bootstrap.github.io/components/buttons/#button-props )
@@ -83,13 +78,6 @@ leftIcon?: ReactElement;
8378
8479MIT Licence
8580
86- ## Links
87-
88- - 🐙 [ GitHub] ( https://github.com/chewhx )
89- - 🖥️ [ Website] ( https://www.chewhx.com )
90- - 📦 [ NPM] ( https://www.npmjs.com/package/react-bootstrap-button )
91- - 🗄️ [ Repo] ( https://github.com/chewhx/react-bootstrap-button )
92-
9381## References
9482
9583- https://github.com/mantinedev/mantine/
0 commit comments