Bedform UINavigation
Navbar
Display navigation.
Navbar
*
string
*
boolean
*
string
Usage
import { Navbar } from "@bedform/ui/navbar";
export function WorldsNavbar() {
return (
<Navbar aria-label="Screen navigation">
<div className="ore-navbar-start">
<button className="ore-navbar-button" type="button" aria-label="Back">
<ore-icon aria-hidden="true">
<svg viewBox="0 0 8 8">
<path
fill="currentColor"
fillRule="evenodd"
d="M5 2h1V1H5zm0 0v1H4V2zm1 6H5V7h-.966V6h1v1H6zM3 4h1V3H3zm0 1V4H2v1zm0 0h1v1H3z"
transform="translate(0 -.5)"
/>
</svg>
</ore-icon>
</button>
</div>
<span className="ore-navbar-title">Worlds</span>
<div className="ore-navbar-actions">
<button className="ore-navbar-action" type="button">
<span className="ore-navbar-action-label">Edit</span>
</button>
</div>
</Navbar>
);
}Navbar renders a nav and forwards its ref to it. Its parts have no components of their own; give them the public classes below. See Icons for ore-icon.
Public classes
| Class | Purpose |
|---|---|
.ore-navbar-start | Leading controls |
.ore-navbar-title | Centered screen title |
.ore-navbar-actions | Trailing action group |
.ore-navbar-button | Square icon action |
.ore-navbar-action | Text or icon-and-text action |
.ore-navbar-action-label | Action text alignment |
CSS variables
| Variable | Purpose |
|---|---|
--ore-navbar-unit | Base size unit |
--ore-navbar-background | Navigation background |
--ore-navbar-bottom-shadow | Bottom bevel color |
--ore-navbar-shadow | Outer drop shadow color |
--ore-navbar-foreground | Text and icon color |
--ore-navbar-action-background | Action background |
--ore-navbar-action-highlight | Action leading highlight |
--ore-navbar-action-shadow | Action leading shadow |
--ore-navbar-text-offset | Vertical text offset |
--ore-navbar-icon-offset | Vertical icon offset |
Accessibility
The native <nav> provides the navigation landmark. Add an accessible label when the page contains more than one navigation, and label icon-only buttons in it.