Navbar

A responsive navigation bar component for site-wide navigation with support for branding, links, and mobile menus.

Anatomy

<script>
  import {
    Navbar,
    NavbarContent,
    NavbarBrand,
    NavbarItemGroup,
    NavbarItem,
    NavbarLink,
  } from "@saas-ui/svelte/components/navbar";
</script>

<Navbar.Root>
  <NavbarContent>
    <NavbarBrand>Logo</NavbarBrand>
    <NavbarItemGroup>
      <NavbarItem>
        <NavbarLink href="/">Home</NavbarLink>
      </NavbarItem>
      <NavbarItem>
        <NavbarLink href="/about">About</NavbarLink>
      </NavbarItem>
    </NavbarItemGroup>
  </NavbarContent>
</Navbar.Root>

Examples

Basic Accessibility

Basic navbar with default styling, brand, and navigation links.

Bordered Accessibility

Navbar with a bottom border using the bordered prop.

Colours Accessibility

Navbar with different colour palettes using the colour prop.

Glass Variant Accessibility

Glass variant navbar with backdrop blur effect for modern aesthetics.

Hide On Scroll Accessibility

Navbar that hides when scrolling down and shows when scrolling up for better content visibility.

Mobile Navigation Accessibility

Responsive navbar with mobile navigation drawer for smaller screens.

Solid Variant Accessibility

Solid variant navbar with a coloured background.

Sticky Accessibility

Sticky navbar that stays at the top when scrolling using position="sticky".

Variants Accessibility

All navbar variants side by side: default, glass, and solid.

Props

Prop Type Default Description
variant default | glass | solid default The visual style of the component.
position static | sticky | fixed static The position of the navbar.
bordered boolean false Whether to show a bottom border.
colour gray | red | orange | yellow | green | teal | blue | cyan | purple | pink | rose accent The colour palette for solid variant.
children any - The content to be rendered inside the component.
class text - Additional CSS classes to apply.