@@ -4,33 +4,25 @@ This is a quick save for anyone looking to add a loading button for Bootstrap in
4
4
5
5
** Note: You must install peer dependency [ bootstrap] ( https://www.npmjs.com/package/bootstrap ) and import the bootstrap stylesheet**
6
6
7
- # v1.0.0
8
-
9
- ### Breaking Changes
7
+ ## Links
10
8
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 )
16
14
17
15
## Installation
18
16
19
- Install the package
17
+ 1 . Install the package and bootstrap
20
18
21
19
``` bash
22
- npm install react-bootstrap-button
20
+ npm install react-bootstrap-button bootstrap
23
21
```
24
22
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/ ) .
32
24
33
- In your App.js:
25
+ 2 . Import bootstrap stylesheet in your App.js:
34
26
35
27
``` javascript
36
28
import ' ../node_modules/bootstrap/dist/css/bootstrap.min.css' ;
@@ -50,7 +42,8 @@ const Component = () => {
50
42
return (
51
43
< BootstrapButton
52
44
variant= " danger"
53
- className= " m-4"
45
+ // You may include all react-bootstrap button props
46
+ className= " m-4" .
54
47
isLoading= {clicked}
55
48
loadingMessage= " This button is loading..."
56
49
onClick= {handleClick}
@@ -68,12 +61,14 @@ const Component = () => {
68
61
Properties for ` <BootstrapButton> ` includes those from React-Bootstrap Button and the following:
69
62
70
63
``` 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
+ };
77
72
```
78
73
79
74
- [ React-Bootstrap Button Props] ( https://react-bootstrap.github.io/components/buttons/#button-props )
@@ -83,13 +78,6 @@ leftIcon?: ReactElement;
83
78
84
79
MIT Licence
85
80
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
-
93
81
## References
94
82
95
83
- https://github.com/mantinedev/mantine/
0 commit comments