Navbar

Top horizontal navigation. Logo + links + actions; supports search bar and mobile-collapsible variant.

Overview

The Navbar component is a core building block of the Byteion design system, providing a robust, accessibility-compliant interface for its specific UI capabilities.

Why this exists

The navbar is the primary horizontal navigation. It anchors the app identity, provides top-level section access, and often houses global actions (search, notifications, user menu).

Mental model

A navbar is a fixed or sticky top bar with app branding, primary navigation links, and global actions. It should remain consistent across all pages.

When to use

• Top-level app navigation • Site header with logo and nav links • Dashboard header with global actions

When not to use

• Do not use as a page-level navigation — use tabs • Avoid for mobile primary nav — use a hamburger + slide-out menu

Basic example

The following example demonstrates standard usage, fully compliant with Byteion's token-first approach.

Variants

Each variant communicates a different meaning. Choose based on priority, not aesthetics.

Single default variant.

Sizes

Size should match the importance and context of the component.

  • md — md size.

States

This component reacts seamlessly to the following interaction and data states:

  • default — Resting appearance before interaction.
  • hover — Pointer is over the element — visual feedback via color or shadow.
  • focus — Keyboard or tab focus — shows ring indicator for accessibility.
  • active — Currently selected or in use.
  • disabled — Non-interactive — grayed out, cursor not-allowed.

Anatomy

• Logo — app identity • Nav links — primary sections • Search — optional global search • Actions — notifications, user menu • Mobile toggle — hamburger menu

Usage guidelines

  • Keep nav links under 7.
  • Make the active page visually clear.
  • Keep the navbar consistent across pages.

Do and Don't

Do

  • Highlight active page.
  • Keep links concise.
  • Maintain consistency.

Don't

  • Do not exceed 7 nav links.
  • Do not change navbar between pages.
  • Do not put page-specific nav here — use tabs or sidebar.

Accessibility

Uses <nav> with aria-label. Active link has aria-current="page".

Role:navigation

Customization

Height, background, and border follow layout tokens.

Compose with React cva()

Use the exportedcva() +cn() utilities to compose your own variant on top of the Byteion tokens.

import { cva, cn, type VariantProps } from '@byteion/react';

const myNavbar = cva('base classes…', {
 variants: {
  accent: { soft:'border-primary-200', loud:'border-primary-500' },
 },
 defaultVariants: { accent:'soft' },
});

type Props = React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof myNavbar>;

Compose with Vue cva()

Use the exportedcva() +cn() utilities inside standard Vue setup blocks.

<script setup lang="ts">
import { computed, useAttrs } from 'vue';
import { cva, type VariantProps } from '@byteion/vue';

interface Props { accent?:'soft' |'loud' }
const props = withDefaults(defineProps<Props>(), { accent:'soft' });
const attrs = useAttrs();

const myNavbar = cva('base classes…', {
  variants: { accent: { soft:'border-primary-200', loud:'border-primary-500' } },
});

const cls = computed(() => myNavbar({ accent: props.accent, class: attrs.class as string | undefined }));
</script>

Runtime events

Byteion keeps framework APIs idiomatic: HTML uses DOM custom events, React uses callback props, and Vue uses emitted events / v-model updates.

HTML / JS events

No HTML runtime events are declared by this adapter.

React callbacks

No React callback events are declared by this adapter.

Vue emits

No Vue emitted events are declared by this adapter.

Remote / AJAX

This component does not implement Byteion JS remote loading. Use normal HTML form submission, framework state, or your application data layer around it.

API Reference

Static HTML composition.

HTML Data Attributes

No custom data attributes required.

React Props · NavbarProps

Extracted directly fromreact/src/components/Navbar.tsx.

export interface NavbarProps extends HTMLAttributes<HTMLElement> {
  /** Visual style. */
  variant?: 'default' | 'glass' | 'plain';
  /** Stick to the top of the viewport. */
  sticky?: boolean;
  children?: ReactNode;
}

Vue Props · NavbarProps

Extracted directly fromvue/src/components/Navbar.vue.

export interface NavbarProps {
  variant?: 'default' | 'glass' | 'plain';
  sticky?: boolean;
}

Developer tips

• Keep global nav stable: do not put every page action in the Navbar. Reserve it for top-level sections and global actions. • Use Breadcrumb or Tabs for local context: page-level navigation belongs below the Navbar. • Use Dropdown for account menu: user profile, billing, team, and settings links belong in a Dropdown — not as direct Navbar links. • Use Drawer/Sidebar for mobile: the Navbar should collapse links into an off-canvas Drawer on small screens. • Make search explicitly labeled: use aria-label="Search" on the input — placeholder is not a replacement.

Common mistakes

Avoid hardcoded neutral colors, placeholder-only labels, duplicated primary actions, and missing keyboard states. Keep this component on Byteion tokens so dashboard, admin, POS, ERP, ecommerce back-office, Laravel, React, and Vue starter-kit screens can be rebranded without rewriting markup.

Production usage tips

  • Test desktop and mobile layouts — navbar should collapse at sm breakpoint.
  • Test sticky behavior during scroll — verify sticky top-4 z-30 does not overlap with content.
  • Test keyboard tab order — brand → nav links → search → actions → user menu should flow logically.
  • Test active link state on every route — verify aria-current="page" is correctly applied.
  • Test search accessibility — aria-label, visible focus ring, and form submission.
  • Test user Dropdown and notification actions — Dropdown must be keyboard accessible.
  • Test dark mode and branded themes — all tokens (bg-card, text-foreground, border-border) adapt automatically.
  • Keep React and Vue output aligned with the core HTML composition — Brand → Nav → Spacer → Actions pattern.

Premium examples

Advanced patterns available in Byteion Pro:

• Command palette trigger — Cmd+K search bar in the center of the navbar with keyboard shortcut hint. • Notification center — bell icon with unread count badge, opens a Drawer or Popover with recent notifications. • Workspace switcher — Dropdown or Popover with workspace list, create workspace, and manage workspaces. • Account menu — Dropdown with profile, billing, team, integrations, and sign out links. • Glass marketing navbar — translucent backdrop-blur navbar over a hero section with CTA button. • Ecommerce admin navbar — order alerts with live count badge, quick create dropdown, and user menu. • Mobile-collapsible app navbar — full-featured navbar that collapses into a Drawer on small screens with brand, links, search, and actions preserved.

Unlock Premium Patterns

Get access to copy-paste ready Pro blocks, SaaS templates, and advanced data-tables built with this component.

Explore Pro Components