Skip to content

Commit 3d1b41b

Browse files
committed
feat/BottomNavigation - added BottomNavigation with Example
1 parent 40e4e87 commit 3d1b41b

18 files changed

+593
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: React Bottom Navigation - Flowbite
3+
description: Use the bottom navigation bar component to allow users to navigate through your website or create a control bar using a menu that is positioned at the bottom of the page
4+
---
5+
6+
The bottom bar component can be used to allow menu items and certain control actions to be performed by the user through the use of a fixed bar positioning on the bottom side of your page.
7+
8+
Check out multiple examples of the bottom navigation component based on various styles, controls, sizes, content and leverage the utility classes from Tailwind CSS to integrate into your own project.
9+
10+
## Default bottom navigation
11+
12+
Use the default bottom navigation bar example to show a list of menu items as buttons to allow the user to navigate through your website based on a fixed position. You can also use anchor tags instead of buttons.
13+
14+
<Example name="bottomNavigation.root" />
15+
16+
## Menu items with border
17+
18+
This example can be used to show a border between the menu items inside the bottom navigation bar.
19+
20+
<Example name="bottomNavigation.withBorder" />

apps/web/data/components.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ export const COMPONENTS_DATA: Component[] = [
3535
link: "/docs/components/badge",
3636
classes: "w-28",
3737
},
38+
{
39+
name: "Bottom Navigation",
40+
image: "/images/components/bottom-bar.svg",
41+
imageDark: "/images/components/bottom-bar-dark.svg",
42+
link: `/docs/components/bottom-navigation`,
43+
classes: "w-28",
44+
},
3845
{
3946
name: "Breadcrumbs",
4047
image: "/images/components/breadcrumbs.svg",

apps/web/data/docs-sidebar.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export const DOCS_SIDEBAR: DocsSidebarSection[] = [
5858
{ title: "Avatar", href: "/docs/components/avatar" },
5959
{ title: "Badge", href: "/docs/components/badge" },
6060
{ title: "Banner", href: "/docs/components/banner", isNew: true },
61+
{ title: "Bottom Navigation", href: "/docs/components/bottom-navigation", isNew: true },
6162
{ title: "Breadcrumb", href: "/docs/components/breadcrumb" },
6263
{ title: "Button", href: "/docs/components/button" },
6364
{ title: "Button group", href: "/docs/components/button-group" },
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
"use client";
2+
3+
import { BottomNavigation } from "flowbite-react";
4+
import { AiFillHome } from "react-icons/ai";
5+
import { CgProfile } from "react-icons/cg";
6+
import { GiSettingsKnobs, GiWallet } from "react-icons/gi";
7+
import type { CodeData } from "~/components/code-demo";
8+
9+
const code = `
10+
'use client';
11+
12+
import { BottomNavigation } from "flowbite-react";
13+
14+
function Component() {
15+
return (
16+
<BottomNavigation>
17+
<BottomNavigation.Item label="Home" icon={AiFillHome} />
18+
<BottomNavigation.Item label="Wallet" icon={GiWallet} />
19+
<BottomNavigation.Item label="Settings" icon={GiSettingsKnobs} />
20+
<BottomNavigation.Item label="Profile" icon={CgProfile} />
21+
</BottomNavigation>
22+
)
23+
}
24+
`;
25+
26+
function Component() {
27+
return (
28+
<div className="relative bottom-0 h-20">
29+
<BottomNavigation
30+
theme={{
31+
root: {
32+
base: "absolute bottom-0 left-0 z-50 h-16 w-full border-t border-gray-200 bg-white dark:border-gray-600 dark:bg-gray-700",
33+
},
34+
}}
35+
>
36+
<BottomNavigation.Item label="Home" icon={AiFillHome} />
37+
<BottomNavigation.Item label="Wallet" icon={GiWallet} />
38+
<BottomNavigation.Item label="Settings" icon={GiSettingsKnobs} />
39+
<BottomNavigation.Item label="Profile" icon={CgProfile} />
40+
</BottomNavigation>
41+
</div>
42+
);
43+
}
44+
45+
export const root: CodeData = {
46+
type: "single",
47+
code: [
48+
{
49+
fileName: "client",
50+
language: "tsx",
51+
code,
52+
},
53+
],
54+
githubSlug: "bottomNavigation/bottomNavigation.root.tsx",
55+
component: <Component />,
56+
};
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
"use client";
2+
3+
import { BottomNavigation } from "flowbite-react";
4+
import { AiFillHome } from "react-icons/ai";
5+
import { CgProfile } from "react-icons/cg";
6+
import { GiSettingsKnobs, GiWallet } from "react-icons/gi";
7+
import type { CodeData } from "~/components/code-demo";
8+
9+
const code = `
10+
'use client';
11+
12+
import { BottomNavigation } from "flowbite-react";
13+
14+
function Component() {
15+
return (
16+
<BottomNavigation bordered>
17+
<BottomNavigation.Item label="Home" icon={AiFillHome} />
18+
<BottomNavigation.Item label="Wallet" icon={GiWallet} />
19+
<BottomNavigation.Item label="Settings" icon={GiSettingsKnobs} />
20+
<BottomNavigation.Item label="Profile" icon={CgProfile} />
21+
</BottomNavigation>
22+
)
23+
}
24+
`;
25+
26+
function Component() {
27+
return (
28+
<div className="relative bottom-0 h-20">
29+
<BottomNavigation
30+
theme={{
31+
root: {
32+
base: "absolute bottom-0 left-0 z-50 h-16 w-full border-t border-gray-200 bg-white dark:border-gray-600 dark:bg-gray-700",
33+
},
34+
}}
35+
bordered
36+
>
37+
<BottomNavigation.Item label="Home" icon={AiFillHome} />
38+
<BottomNavigation.Item label="Wallet" icon={GiWallet} />
39+
<BottomNavigation.Item label="Settings" icon={GiSettingsKnobs} />
40+
<BottomNavigation.Item label="Profile" icon={CgProfile} />
41+
</BottomNavigation>
42+
</div>
43+
);
44+
}
45+
46+
export const withBorder: CodeData = {
47+
type: "single",
48+
code: [
49+
{
50+
fileName: "client",
51+
language: "tsx",
52+
code,
53+
},
54+
],
55+
githubSlug: "bottomNavigation/bottomNavigation.withBorder.tsx",
56+
component: <Component />,
57+
};
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { root } from "./bottomNavigation.root";
2+
export { withBorder } from "./bottomNavigation.withBorder";

apps/web/examples/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export * as avatar from "./avatar";
44
export * as badge from "./badge";
55
export * as banner from "./banner";
66
export * as blockquote from "./blockquote";
7+
export * as bottomNavigation from "./bottomNavigation";
78
export * as breadcrumb from "./breadcrumb";
89
export * as button from "./button";
910
export * as buttonGroup from "./buttonGroup";
Lines changed: 44 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)