Bottom Navigation
Provide quick access to primary navigation items
Use the BottomNavigation
component to display a fixed menu with primary navigation elements at the bottom of your pages. Being fixed, they remain visible during scrolling and help users easily reach cornerstone content on your website.
The BottomNavigation
component expects an items
prop that describes the navigation items. Each navigation item can have the following properties:
name
: The name of the navigation item.href
: The link of the navigation item.target
: The target of the anchor, such as_blank
for opening links in a new tab.icon
: An icon for the navigation item. It can be an icon type for the Astro component, or an SVG string for Svelte/React components. For available icon types, please see the documentation of theIcon
component.tooltip
: You can optionally set a tooltip for the item in case you want to display icons only and you want to provide additional context to users.
All properties are optional, meaning you can create the navigation with text or icons only:
Tooltips
If you use icons only, you may want to provide additional context to users about your navigation items. For this, you can use the tooltip
prop that adds a tooltip for the items:
Styles
The component also supports two different stylings. Use the separated
prop to add borders between elements, and use the floating
prop to make the element rounded and padded around the viewport:
Max width
In its default configuration, the navigation items will equally take up the available space of the viewport:
If you want to limit this, you can use the maxWidth
prop which sets a maximum width for the container of the items:
You can also set this option globally through overriding the following CSS variable:
API
Prop | Purpose |
---|---|
items | Sets the navigation items. |
items.name | Sets the name of the navigation item. |
items.href | Sets the link for the navigation item. |
items.target | Sets the target of the anchor. |
items.icon | Sets an icon for the navigation item. |
items.tooltip | Sets a tooltip for the navigation item. |
separated | Adds borders between the navigation items. |
floating | Adds paddings around the navigation. |
maxWidth | Sets the maximum width of the container of items. |
className | Pass additional CSS classes for the component. |
Request improvement for this page