The bottom navigation of a phone app (Material's navigation bar, the iOS tab bar): three to five destinations with an icon, a label and a badge, the current one marked by a pill. Links or a value; an action button in the middle; hides on scroll.
With href items it marks the link to this page (aria-current="page"); without, it is a control (value, change). Clear of the home indicator (safe-area inset). In a ray-app-shell, put it in the bottom slot.
Property
Attribute
Type
Default
Description
value
valuereflects
string
The current destination (an item's value, else its href, else its label).
label
label
string
Main(text bottom-nav.label)
Accessible name of the navigation.
labels
labelsreflects
always | active | never
always
Which labels show (the others stay for assistive technology).
indicator
indicatorreflects
pill | line | none
pill
How the current destination is marked besides its color.
color
colorreflects
string
A palette color or any CSS color for the current item and the action (default: primary).
variant
variantreflects
default | floating
default
default: a bar across the bottom; floating: a rounded bar off the edges.
hideOnScroll
hide-on-scrollreflects
boolean
Slides away while the content scrolls down, back on the way up.
fixed
fixedreflects
boolean
Pinned to the bottom of the window (outside a shell).
scrollTarget
scroll-target
string
A selector of the element whose scrolling it follows (default: its shell's, else the window).
Event
Description
change
The user picked another destination (read value).
ray-select
An action item was pressed.
Slot
Description
(default)
ray-bottom-nav-item elements (3 to 5).
Part
Description
nav
The <nav>.
<ray-bottom-nav-item>
A link with href, else a button. The badge is read with the label ("Messages, 3").
Property
Attribute
Type
Default
Description
value
valuereflects
string
Its value (default: its href, else its label).
label
label
string
The label.
icon
icon
string
An icon of the registry, drawn filled on the current item when it has a filled version (or put one in the icon slot: yours, as it is).
href
hrefreflects
string
Makes it a link.
badge
badge
string
A count or a short text on the icon.
dot
dotreflects
boolean
A dot on the icon (something new).
active
activereflects
boolean
Set by the bar: the current destination.
disabled
disabledreflects
boolean
Not interactive.
action
actionreflects
boolean
A raised round button ("New"): it fires ray-select on the bar, it is not a destination.
Slot
Description
icon
A custom icon (a ray-icon, an svg, an avatar).
Part
Description
item
The link or button.
indicator
The pill behind the icon.
badge
The badge.
label
The label.
Texts
What it writes itself, in English; setStrings() translates them (Getting started: Languages).