-
-
Notifications
You must be signed in to change notification settings - Fork 455
Feat/BottomNavigation - added BottomNavigation with Example #1333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dhavalveera
wants to merge
9
commits into
themesberg:main
Choose a base branch
from
dhavalveera:feat/bottom-nav
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3d1b41b
feat/BottomNavigation - added BottomNavigation with Example
dhavalveera a98e9cf
BottomNavigation.spec.tsx async error fixed
dhavalveera 477305d
feat: refactored the code for better readability based on codeabbitai…
dhavalveera 2dbc413
BottomNavigation with tooltip example added
dhavalveera 9245925
small fix
dhavalveera d2ffd70
fix: in Docs Theme & Reference link added
dhavalveera 9035b48
fix: Docs Refernece URL typo fixed
dhavalveera 8fa5082
Merge branch 'main' into feat/bottom-nav
dhavalveera 1243234
Merge branch 'main' into feat/bottom-nav
dhavalveera File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
title: React Bottom Navigation - Flowbite | ||
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 | ||
--- | ||
|
||
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. | ||
|
||
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. | ||
|
||
## Default bottom navigation | ||
|
||
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. | ||
|
||
<Example name="bottomNavigation.root" /> | ||
|
||
## Menu items with border | ||
|
||
This example can be used to show a border between the menu items inside the bottom navigation bar. | ||
|
||
<Example name="bottomNavigation.withBorder" /> | ||
|
||
## Example with Tooltip | ||
|
||
This example can be used to show a Tooltip on the hover on the menu items. | ||
|
||
<Example name="bottomNavigation.withTooltip" /> | ||
|
||
## Theme | ||
|
||
To learn more about how to customize the appearance of components, please see the [Theme docs](/docs/customize/theme). | ||
|
||
<Theme name="bottomNavigation" /> | ||
|
||
## References | ||
|
||
- [Flowbite Bottom Navigation](https://flowbite.com/docs/forms/phone-input/) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
apps/web/examples/bottomNavigation/bottomNavigation.root.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
"use client"; | ||
|
||
import { BottomNavigation } from "flowbite-react"; | ||
import { AiFillHome } from "react-icons/ai"; | ||
import { CgProfile } from "react-icons/cg"; | ||
import { GiSettingsKnobs, GiWallet } from "react-icons/gi"; | ||
import type { CodeData } from "~/components/code-demo"; | ||
|
||
const code = ` | ||
"use client"; | ||
|
||
import { BottomNavigation } from "flowbite-react"; | ||
|
||
function Component() { | ||
return ( | ||
<BottomNavigation> | ||
<BottomNavigation.Item label="Home" icon={AiFillHome} /> | ||
<BottomNavigation.Item label="Wallet" icon={GiWallet} /> | ||
<BottomNavigation.Item label="Settings" icon={GiSettingsKnobs} /> | ||
<BottomNavigation.Item label="Profile" icon={CgProfile} /> | ||
</BottomNavigation> | ||
) | ||
} | ||
`; | ||
|
||
function Component() { | ||
return ( | ||
<div className="relative bottom-0 h-20"> | ||
<BottomNavigation | ||
theme={{ | ||
root: { | ||
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", | ||
}, | ||
}} | ||
> | ||
<BottomNavigation.Item label="Home" icon={AiFillHome} /> | ||
<BottomNavigation.Item label="Wallet" icon={GiWallet} /> | ||
<BottomNavigation.Item label="Settings" icon={GiSettingsKnobs} /> | ||
<BottomNavigation.Item label="Profile" icon={CgProfile} /> | ||
</BottomNavigation> | ||
</div> | ||
); | ||
} | ||
|
||
export const root: CodeData = { | ||
type: "single", | ||
code: [ | ||
{ | ||
fileName: "client", | ||
language: "tsx", | ||
code, | ||
}, | ||
], | ||
githubSlug: "bottomNavigation/bottomNavigation.root.tsx", | ||
component: <Component />, | ||
}; |
57 changes: 57 additions & 0 deletions
57
apps/web/examples/bottomNavigation/bottomNavigation.withBorder.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
"use client"; | ||
|
||
import { BottomNavigation } from "flowbite-react"; | ||
import { AiFillHome } from "react-icons/ai"; | ||
import { CgProfile } from "react-icons/cg"; | ||
import { GiSettingsKnobs, GiWallet } from "react-icons/gi"; | ||
import type { CodeData } from "~/components/code-demo"; | ||
|
||
const code = ` | ||
"use client"; | ||
|
||
import { BottomNavigation } from "flowbite-react"; | ||
|
||
function Component() { | ||
return ( | ||
<BottomNavigation bordered> | ||
<BottomNavigation.Item label="Home" icon={AiFillHome} /> | ||
<BottomNavigation.Item label="Wallet" icon={GiWallet} /> | ||
<BottomNavigation.Item label="Settings" icon={GiSettingsKnobs} /> | ||
<BottomNavigation.Item label="Profile" icon={CgProfile} /> | ||
</BottomNavigation> | ||
) | ||
} | ||
`; | ||
|
||
function Component() { | ||
return ( | ||
<div className="relative bottom-0 h-20"> | ||
<BottomNavigation | ||
theme={{ | ||
root: { | ||
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", | ||
}, | ||
}} | ||
bordered | ||
> | ||
<BottomNavigation.Item label="Home" icon={AiFillHome} /> | ||
<BottomNavigation.Item label="Wallet" icon={GiWallet} /> | ||
<BottomNavigation.Item label="Settings" icon={GiSettingsKnobs} /> | ||
<BottomNavigation.Item label="Profile" icon={CgProfile} /> | ||
</BottomNavigation> | ||
</div> | ||
); | ||
} | ||
|
||
export const withBorder: CodeData = { | ||
type: "single", | ||
code: [ | ||
{ | ||
fileName: "client", | ||
language: "tsx", | ||
code, | ||
}, | ||
], | ||
githubSlug: "bottomNavigation/bottomNavigation.withBorder.tsx", | ||
component: <Component />, | ||
}; |
56 changes: 56 additions & 0 deletions
56
apps/web/examples/bottomNavigation/bottomNavigation.withTooltip.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
"use client"; | ||
|
||
import { BottomNavigation } from "flowbite-react"; | ||
import { AiFillHome } from "react-icons/ai"; | ||
import { CgProfile } from "react-icons/cg"; | ||
import { GiSettingsKnobs, GiWallet } from "react-icons/gi"; | ||
import type { CodeData } from "~/components/code-demo"; | ||
|
||
const code = ` | ||
"use client"; | ||
|
||
import { BottomNavigation } from "flowbite-react"; | ||
|
||
function Component() { | ||
return ( | ||
<BottomNavigation> | ||
<BottomNavigation.Item label="Home" icon={AiFillHome} showTooltip /> | ||
<BottomNavigation.Item label="Wallet" icon={GiWallet} showTooltip /> | ||
<BottomNavigation.Item label="Settings" icon={GiSettingsKnobs} showTooltip /> | ||
<BottomNavigation.Item label="Profile" icon={CgProfile} showTooltip /> | ||
</BottomNavigation> | ||
) | ||
} | ||
`; | ||
|
||
function Component() { | ||
return ( | ||
<div className="relative bottom-0 h-20"> | ||
<BottomNavigation | ||
theme={{ | ||
root: { | ||
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", | ||
}, | ||
}} | ||
> | ||
<BottomNavigation.Item label="Home" icon={AiFillHome} showTooltip /> | ||
<BottomNavigation.Item label="Wallet" icon={GiWallet} showTooltip /> | ||
<BottomNavigation.Item label="Settings" icon={GiSettingsKnobs} showTooltip /> | ||
<BottomNavigation.Item label="Profile" icon={CgProfile} showTooltip /> | ||
</BottomNavigation> | ||
</div> | ||
); | ||
} | ||
|
||
export const withTooltip: CodeData = { | ||
type: "single", | ||
code: [ | ||
{ | ||
fileName: "client", | ||
language: "tsx", | ||
code, | ||
}, | ||
], | ||
githubSlug: "bottomNavigation/bottomNavigation.withTooltip.tsx", | ||
component: <Component />, | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export { root } from "./bottomNavigation.root"; | ||
export { withBorder } from "./bottomNavigation.withBorder"; | ||
export { withTooltip } from "./bottomNavigation.withTooltip"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.