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

ClassPurpose
.ore-navbar-startLeading controls
.ore-navbar-titleCentered screen title
.ore-navbar-actionsTrailing action group
.ore-navbar-buttonSquare icon action
.ore-navbar-actionText or icon-and-text action
.ore-navbar-action-labelAction text alignment

CSS variables

VariablePurpose
--ore-navbar-unitBase size unit
--ore-navbar-backgroundNavigation background
--ore-navbar-bottom-shadowBottom bevel color
--ore-navbar-shadowOuter drop shadow color
--ore-navbar-foregroundText and icon color
--ore-navbar-action-backgroundAction background
--ore-navbar-action-highlightAction leading highlight
--ore-navbar-action-shadowAction leading shadow
--ore-navbar-text-offsetVertical text offset
--ore-navbar-icon-offsetVertical 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.

On this page