Navigation Core Stable

Navbar

A horizontal top-of-page bar with a brand mark, navigation links, and actions on the right.

Preview

Installation

pnpm add fancy-ui-svelte
import { Navbar } from 'fancy-ui-svelte'

Usage

svelte
<script lang="ts">
  import { Navbar } from 'fancy-ui-svelte';
</script>

<Navbar />

Examples

Basic Usage

With Actions

Search and a sign-in button on the right.

Sticky Bar

Pinned to the top of a scrolling container with a blurred background.

Props

PropTypeDefaultDescription
label string"Main"Accessible name for the nav landmark.
sticky booleanfalsePins the bar to the top with `position: sticky` and a translucent, blurred background.
bordered booleantrueDraws a 1px hairline along the bottom edge.
class string-Additional CSS classes, merged onto the root.
ref HTMLElement | nullnullBindable reference to the root nav element.
NavbarLink.href *string-Destination URL.
NavbarLink.current booleanfalseMarks this as the current page — aria-current="page" plus a visible weight/colour change.
NavbarLink.external booleanfalseOpens in a new tab with a safe rel, and notes it for assistive tech.
NavbarLink.disabled booleanfalseStrips the link out of the click and keyboard-activation paths.
NavbarLink.onclick (event: MouseEvent) => void-Native click handler. Never called while disabled.
NavbarLink.class string-Additional CSS classes, merged onto the anchor.
NavbarLink.ref HTMLAnchorElement | nullnullBindable reference to the anchor element.

Slots

SlotDescription
brandThe brand mark / wordmark, on the left.
childrenThe navigation links, between the brand and the actions.
actionsActions on the right — search, sign-in, a theme switch.
NavbarLink.childrenThe link's label.