Skip to content

Commit 2dbc413

Browse files
committed
BottomNavigation with tooltip example added
1 parent 477305d commit 2dbc413

File tree

5 files changed

+65
-2
lines changed

5 files changed

+65
-2
lines changed

apps/web/content/docs/components/bottom-navigation.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,9 @@ Use the default bottom navigation bar example to show a list of menu items as bu
1818
This example can be used to show a border between the menu items inside the bottom navigation bar.
1919

2020
<Example name="bottomNavigation.withBorder" />
21+
22+
## Example with Tooltip
23+
24+
This example can be used to show a Tooltip on the hover on the menu items.
25+
26+
<Example name="bottomNavigation.withTooltip" />

apps/web/examples/bottomNavigation/bottomNavigation.root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { GiSettingsKnobs, GiWallet } from "react-icons/gi";
77
import type { CodeData } from "~/components/code-demo";
88

99
const code = `
10-
'use client';
10+
"use client";
1111
1212
import { BottomNavigation } from "flowbite-react";
1313

apps/web/examples/bottomNavigation/bottomNavigation.withBorder.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { GiSettingsKnobs, GiWallet } from "react-icons/gi";
77
import type { CodeData } from "~/components/code-demo";
88

99
const code = `
10-
'use client';
10+
"use client";
1111
1212
import { BottomNavigation } from "flowbite-react";
1313
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} showTooltip />
18+
<BottomNavigation.Item label="Wallet" icon={GiWallet} showTooltip />
19+
<BottomNavigation.Item label="Settings" icon={GiSettingsKnobs} showTooltip />
20+
<BottomNavigation.Item label="Profile" icon={CgProfile} showTooltip />
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} showTooltip />
37+
<BottomNavigation.Item label="Wallet" icon={GiWallet} showTooltip />
38+
<BottomNavigation.Item label="Settings" icon={GiSettingsKnobs} showTooltip />
39+
<BottomNavigation.Item label="Profile" icon={CgProfile} showTooltip />
40+
</BottomNavigation>
41+
</div>
42+
);
43+
}
44+
45+
export const withTooltip: CodeData = {
46+
type: "single",
47+
code: [
48+
{
49+
fileName: "client",
50+
language: "tsx",
51+
code,
52+
},
53+
],
54+
githubSlug: "bottomNavigation/bottomNavigation.withBorder.tsx",
55+
component: <Component />,
56+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export { root } from "./bottomNavigation.root";
22
export { withBorder } from "./bottomNavigation.withBorder";
3+
export { withTooltip } from "./bottomNavigation.withTooltip";

0 commit comments

Comments
 (0)