BottomNav
BottomNav provides a mobile-style fixed bottom navigation bar with touch-friendly items.
Quick Start
from faststrap import BottomNav, BottomNavItem
BottomNav(
BottomNavItem("Home", href="/", icon="house", active=True),
BottomNavItem("Search", href="/search", icon="search"),
BottomNavItem("Profile", href="/profile", icon="person"),
)
Common Usage
BottomNav(
BottomNavItem("Feed", href="/feed", icon="newspaper"),
BottomNavItem("Saved", href="/saved", icon="bookmark"),
BottomNavItem("Settings", href="/settings", icon="gear"),
variant="light",
fixed=True,
)
Parameters
BottomNav
| Parameter | Type | Default | Description |
|---|---|---|---|
*children |
Any |
Required | BottomNavItem children |
variant |
str \| None |
None |
Color scheme (light, dark, or custom) |
fixed |
bool \| None |
True |
Fixed to viewport bottom |
labels |
bool |
True |
Reserved for label visibility behavior |
**kwargs |
Any |
- | Additional HTML attributes |
BottomNavItem
| Parameter | Type | Default | Description |
|---|---|---|---|
label |
str |
Required | Item text |
href |
str |
"#" |
Link destination |
icon |
str \| None |
None |
Bootstrap icon name |
active |
bool |
False |
Active route styling |
cls |
str \| None |
None |
Extra classes |
**kwargs |
Any |
- | Additional attributes |
faststrap.components.navigation.bottom_nav.BottomNav(*children, variant=None, fixed=True, labels=True, **kwargs)
Bottom Navigation Bar for mobile applications.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*children
|
Any
|
BottomNavItem components |
()
|
variant
|
str | None
|
Color scheme (light, dark, or custom class) |
None
|
fixed
|
bool | None
|
Fix to bottom of viewport (default: True) |
True
|
labels
|
bool
|
Show labels (True) or icons only (False) |
True
|
**kwargs
|
Any
|
Additional attributes |
{}
|
Source code in src/faststrap/components/navigation/bottom_nav.py
faststrap.components.navigation.bottom_nav.BottomNavItem(label, href='#', icon=None, active=False, cls=None, **kwargs)
Individual item for BottomNav.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
Text label |
required |
href
|
str
|
Link URL |
'#'
|
icon
|
str | None
|
Bootstrap icon name (e.g., "house", "person") |
None
|
active
|
bool
|
Active state |
False
|
cls
|
str | None
|
Custom classes |
None
|
**kwargs
|
Any
|
Additional attributes |
{}
|