HTML
xxxxxxxxxx
1
<!DOCTYPE html>
2
<html lang="en">
3
<head>
4
<meta charset="utf-8" />
5
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6
<meta name="viewport" content="width=device-width, initial-scale=1" />
7
<meta name="theme-color" content="#000000" />
8
<meta
9
name="description"
10
content="Web site created using create-react-app"
11
/>
12
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13
<link
14
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
15
rel="stylesheet"
16
/>
17
<link
18
href="https://use.fontawesome.com/releases/v5.15.1/css/all.css"
19
rel="stylesheet"
20
/>
21
22
<!--
23
manifest.json provides metadata used when your web app is installed on a
24
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
25
-->
26
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
27
<!--
28
Notice the use of %PUBLIC_URL% in the tags above.
29
It will be replaced with the URL of the `public` folder during the build.
30
Only files inside the `public` folder can be referenced from the HTML.
31
32
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
33
work correctly both with client-side routing and a non-root public URL.
34
Learn how to configure a non-root public URL by running `npm run build`.
35
-->
36
<title>MDBReact5 Template App</title>
37
</head>
38
<body>
39
<noscript>You need to enable JavaScript to run this app.</noscript>
40
<div id="root"></div>
41
<!--
42
This HTML file is a template.
43
If you open it directly in the browser, you will see an empty page.
44
45
You can add webfonts, meta tags, or analytics to this file.
46
The build step will place the bundled scripts into the <body> tag.
47
48
To begin the development, run `npm start` or `yarn start`.
49
To create a production bundle, use `npm run build` or `yarn build`.
50
-->
51
</body>
52
</html>
53
SCSS
xxxxxxxxxx
1
body {
2
margin: 0;
3
font-family: Roboto, Helvetica, Arial, sans-serif;
4
-webkit-font-smoothing: antialiased;
5
-moz-osx-font-smoothing: grayscale;
6
}
7
8
code {
9
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
10
monospace;
11
}
12
JS (TypeScript)
xxxxxxxxxx
1
import React, { useState } from 'react';
2
import {
3
MDBContainer,
4
MDBCol,
5
MDBNavbar,
6
MDBNavbarBrand,
7
MDBNavbarToggler,
8
MDBIcon,
9
MDBNavbarNav,
10
MDBNavbarItem,
11
MDBNavbarLink,
12
MDBBtn,
13
MDBCollapse,
14
MDBDropdown,
15
MDBDropdownToggle,
16
MDBDropdownMenu,
17
MDBDropdownItem,
18
MDBBadge,
19
MDBRow,
20
} from 'mdb-react-ui-kit';
21
22
function App() {
23
const [showNav, setShowNav] = useState(false);
24
25
return (
26
<MDBContainer fluid>
27
<section>
28
<div className='p-3 text-center bg-white border-bottom shadow-4'>
29
<MDBContainer fluid>
30
<MDBRow>
31
<MDBCol md='4' className='justify-content-center justify-content-md-start mb-3 mb-md-0'>
32
<MDBNavbarBrand className='ms-1 ms-lg-3 d-flex align-items-center' href='#'>
33
<MDBIcon icon='flask' className='text-primary me-2' />
34
<small className='fw-bold text-dark'>CodeLab</small>
35
</MDBNavbarBrand>
36
</MDBCol>
37
38
<MDBCol md='4'>
39
<form className='d-flex input-group w-auto me-3'>
40
<span className='input-group-text border-0' id='search-addon'>
41
<MDBIcon icon='search' />
42
</span>
43
<input
44
type='search'
45
className='form-control rounded'
46
placeholder='Search'
47
aria-label='Search'
48
aria-describedby='search-addon'
49
/>
50
</form>
51
</MDBCol>
52
53
<MDBCol md='4' className='d-flex justify-content-center justify-content-md-end align-items-center'>
54
<MDBDropdown>
55
<MDBDropdownToggle style={{ cursor: 'pointer' }} tag='a' className='text-reset me-3 hidden-arrow'>
56
<MDBIcon icon='bell' />
57
</MDBDropdownToggle>
58
<MDBDropdownMenu>
59
<MDBDropdownItem link>Some news</MDBDropdownItem>
60
<MDBDropdownItem link>Another news</MDBDropdownItem>
61
<MDBDropdownItem link>Something else here</MDBDropdownItem>
62
</MDBDropdownMenu>
63
</MDBDropdown>
64
65
<MDBDropdown>
66
<MDBDropdownToggle tag='a' style={{ cursor: 'pointer' }} className='me-3 hidden-arrow'>
67
<MDBIcon className='m-0' flag='uk' />
68
</MDBDropdownToggle>
69
<MDBDropdownMenu>
70
<MDBDropdownItem link>
71
<MDBIcon flag='uk' />
72
English <MDBIcon color='success' icon='check' className='ms-2' />
73
</MDBDropdownItem>
74
<MDBDropdownItem divider />
75
<MDBDropdownItem link>
76
<MDBIcon flag='pl' />
77
Polski
78
</MDBDropdownItem>
79
<MDBDropdownItem link>
80
<MDBIcon flag='cn' />
81
中文
82
</MDBDropdownItem>
83
<MDBDropdownItem link>
84
<MDBIcon flag='jp' />
85
日本語
86
</MDBDropdownItem>
87
<MDBDropdownItem link>
88
<MDBIcon flag='de' />
89
Deutsch
90
</MDBDropdownItem>
91
<MDBDropdownItem link>
92
<MDBIcon flag='fr' />
93
Français
94
</MDBDropdownItem>
95
<MDBDropdownItem link>
96
<MDBIcon flag='es' />
97
Español
98
</MDBDropdownItem>
99
<MDBDropdownItem link>
100
<MDBIcon flag='ru' />
101
Русский
102
</MDBDropdownItem>
103
<MDBDropdownItem link>
104
<MDBIcon flag='pt' />
105
Português
106
</MDBDropdownItem>
107
</MDBDropdownMenu>
108
</MDBDropdown>
109
110
<MDBDropdown>
111
<MDBDropdownToggle style={{ cursor: 'pointer' }} tag='a' className='text-reset me-3 hidden-arrow'>
112
<img
113
src='https://mdbcdn.b-cdn.net/img/new/avatars/2.webp'
114
className='rounded-circle'
115
height='25'
116
alt='Black and White Portrait of a Man'
117
loading='lazy'
118
/>
119
</MDBDropdownToggle>
120
<MDBDropdownMenu>
121
<MDBDropdownItem link>My profile</MDBDropdownItem>
122
<MDBDropdownItem link>Settings</MDBDropdownItem>
123
<MDBDropdownItem link>Logout</MDBDropdownItem>
124
</MDBDropdownMenu>
125
</MDBDropdown>
126
</MDBCol>
127
</MDBRow>
128
</MDBContainer>
129
</div>
130
131
<MDBNavbar expand='lg' light className='px-2 bg-white'>
132
<MDBContainer className='justify-content-between'>
133
<MDBNavbarToggler
134
aria-controls='navbarSupportedContent'
135
aria-label='Toggle navigation'
136
onClick={() => setShowNav(!showNav)}
137
>
138
<MDBIcon icon='bars' fas />
139
</MDBNavbarToggler>
140
141
<MDBCollapse navbar show={showNav}>
142
<MDBNavbarNav className='mr-auto mb-2 mb-lg-0'>
143
<MDBNavbarItem>
144
<MDBNavbarLink active aria-current='page' href='#'>
145
Dashboard
146
</MDBNavbarLink>
147
</MDBNavbarItem>
148
<MDBNavbarItem>
149
<MDBNavbarLink href='#'>Pricing</MDBNavbarLink>
150
</MDBNavbarItem>
151
152
<MDBNavbarItem>
153
<MDBNavbarLink disabled href='#'>
154
Contact
155
</MDBNavbarLink>
156
</MDBNavbarItem>
157
158
<MDBNavbarItem>
159
<MDBNavbarLink disabled href='#'>
160
Services
161
</MDBNavbarLink>
162
</MDBNavbarItem>
163
</MDBNavbarNav>
164
</MDBCollapse>
165
166
<MDBBtn className='mb-0 me-3'>
167
Download App <MDBIcon icon='download' className='ms-2' />
168
</MDBBtn>
169
</MDBContainer>
170
</MDBNavbar>
171
</section>
172
</MDBContainer>
173
);
174
}
175
176
export default App;
177
Console errors: 0