Skip to content

Commit 16a3e59

Browse files
committed
update docs
1 parent 41c392f commit 16a3e59

File tree

3 files changed

+28
-35
lines changed

3 files changed

+28
-35
lines changed

README.md

Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -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
3628
import '../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 = () => {
6861
Properties 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

8479
MIT 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/

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/BootstrapButton.stories.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ export const Loading = () => {
2626
}, 4000);
2727
};
2828
return (
29-
<Button isLoading={loading} onClick={toggle} leftIcon={<FaFireAlt />}>
29+
<Button
30+
isLoading={loading}
31+
onClick={toggle}
32+
leftIcon={<FaFireAlt />}
33+
spinnerPosition="right"
34+
>
3035
Click to action
3136
</Button>
3237
);

0 commit comments

Comments
 (0)