Skip to content

Commit f73263c

Browse files
mhrrmkNecati Özmen
andauthored
Update Bootstrap docs (#213)
* update bootstrap docs * Update documentation/docs/bootstrap.md Co-authored-by: Necati Özmen <[email protected]> Co-authored-by: Necati Özmen <[email protected]>
1 parent 64c52e5 commit f73263c

File tree

1 file changed

+77
-6
lines changed

1 file changed

+77
-6
lines changed

documentation/docs/bootstrap.md

Lines changed: 77 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,59 @@ description: How to use Bootstrap with Next.js?
77

88
Quickly design and customize responsive mobile-first sites with Bootstrap, the world’s most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.
99

10-
:::tip
10+
### React Bootstrap
1111

12-
If you also add `sass/scss` under CSS Preprocessors during creation phase, you can easily [customize Bootstrap](https://getbootstrap.com/docs/4.6/getting-started/theming/#sass). Bootstrap’s source ***sass*** files are added under `src/styles` directory.
12+
**superplate** uses `react-bootstrap` component library for bootstrap plugin. React-Bootstrap replaces the Bootstrap JavaScript. Each component has been built from scratch as a true React component, without unneeded dependencies like jQuery.
13+
[Refer to official documentation for detailed usage. &#8594](https://react-bootstrap.github.io/getting-started/introduction)
1314

14-
:::
15+
- Some stylesheet is required to use React Bootstrap components.
16+
17+
```tsx title="pages/_app.tsx"
18+
import "bootstrap/dist/css/bootstrap.min.css";
19+
```
20+
21+
### Using Components
22+
23+
- Import from `react-bootstrap`
24+
25+
```js
26+
import { Button } from 'react-bootstrap';
27+
```
28+
29+
- Or import individual components
30+
31+
```js
32+
import Button from 'react-bootstrap/Button';
33+
```
34+
35+
- Customize components with props
36+
37+
```tsx title="src/components/main/index.tsx"
38+
<Button
39+
href="https://pankod.github.io/superplate/"
40+
target="_blank"
41+
variant="primary"
42+
size="lg">
43+
Docs
44+
</Button>
45+
```
46+
47+
- Bootstrap utility classes can also be used with components
48+
```tsx title="src/components/cards/index.tsx"
49+
<Container className="my-5 flex-grow-1">
50+
...
51+
</Container>
52+
```
1553

1654
### Using Sass with Bootstrap
17-
If `sass/scss` is selected you can start [customizing](https://getbootstrap.com/docs/4.6/getting-started/theming/#sass) in `src/styles/app.scss`
55+
:::tip
56+
57+
If you also add `sass/scss` under CSS Preprocessors during creation phase, you can easily [customize Bootstrap](https://getbootstrap.com/docs/4.6/getting-started/theming/#sass). Bootstrap’s source ***sass*** files are added under `src/styles` directory.
1858
[See Sass/SCSS doc &#8594](scss.md)
1959

20-
If it's not selected, Sass can be added later to customize Bootstrap,
60+
:::
61+
62+
If `sass/scss` plugin is not selected, Sass can be added later to customize Bootstrap,
2163

2264
- Add a custom scss file `app.scss` under `src/styles`
2365

@@ -73,4 +115,33 @@ npm install sass
73115
```
74116

75117
### Adding Bootstrap to your project later
76-
If you didn't add bootstrap during project creation phase, you can add it later following [official docs](https://getbootstrap.com/docs/4.6/getting-started/introduction/)
118+
If you didn't choose the plugin during project creation phase, you can follow the instructions below to add it.
119+
120+
- Install `react-bootstrap` and `bootstrap` packages
121+
122+
import Tabs from '@theme/Tabs';
123+
import TabItem from '@theme/TabItem';
124+
125+
<Tabs
126+
defaultValue="npm"
127+
values={[
128+
{label: 'npm', value: 'npm'},
129+
{label: 'yarn', value: 'yarn'},
130+
]}>
131+
<TabItem value="npm">
132+
133+
```bash
134+
npm install react-bootstrap bootstrap
135+
```
136+
</TabItem>
137+
<TabItem value="yarn">
138+
139+
```bash
140+
yarn add react-bootstrap bootstrap
141+
```
142+
</TabItem>
143+
</Tabs>
144+
145+
- [Follow instructions in React Bootstrap](#react-bootstrap)
146+
147+
[Refer to official documentation on installation for detailed usage. &#8594](https://react-bootstrap.github.io/getting-started/introduction#installation)

0 commit comments

Comments
 (0)