You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/docs/bootstrap.md
+77-6Lines changed: 77 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,17 +7,59 @@ description: How to use Bootstrap with Next.js?
7
7
8
8
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.
9
9
10
-
:::tip
10
+
### React Bootstrap
11
11
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. →](https://react-bootstrap.github.io/getting-started/introduction)
13
14
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
+
importButtonfrom'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
+
<ContainerclassName="my-5 flex-grow-1">
50
+
...
51
+
</Container>
52
+
```
15
53
16
54
### 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.
18
58
[See Sass/SCSS doc →](scss.md)
19
59
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,
21
63
22
64
- Add a custom scss file `app.scss` under `src/styles`
23
65
@@ -73,4 +115,33 @@ npm install sass
73
115
```
74
116
75
117
### 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
+
<TabItemvalue="npm">
132
+
133
+
```bash
134
+
npm install react-bootstrap bootstrap
135
+
```
136
+
</TabItem>
137
+
<TabItemvalue="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. →](https://react-bootstrap.github.io/getting-started/introduction#installation)
0 commit comments