Skip to content
Navigation Fancy Stable

TickNav

.md

A navigation list on a ruler of tick marks: every line the pointer crosses plucks like a string, neighbouring lines and ticks stretch and light up on springs, and an optional preview card follows the pointer.

Available for Svelte 5, React, and Vue 3.

Preview

Installation

pnpm add fancy-ui-svelte
import { TickNav } from "fancy-ui-svelte";

Usage

svelte
<script lang="ts">
	import { TickNav, type TickNavItem } from "fancy-ui-svelte";

	const items: TickNavItem[] = [
		{ id: "signal", label: "01 Signal" },
		{ id: "noise", label: "02 Noise" },
		{ id: "pulse", label: "03 Pulse" },
		{ id: "drift", label: "04 Drift", badge: "New" },
		{ id: "echo", label: "05 Echo" },
		{ id: "static", label: "06 Static" },
		{ id: "carrier", label: "07 Carrier" },
	];

	let value = $state("pulse");
</script>

<div
	class="flex w-full justify-center rounded-xl bg-[#07060b] py-10 text-[15px] tracking-tight text-white"
	style="--ft-accent: oklch(0.72 0.19 300)"
>
	<TickNav {items} bind:value variant="neon" ariaLabel="Channels" sound />
</div>

Examples

Neon

Glowing lines and a beam of light riding every pluck. On an HDR display the light runs brighter than white.

With Preview

A card that follows the pointer while a row is hovered.

Classic

The plain ruler: no glow, accent lines only.

Props

PropTypeDefaultDescription
items *TickNavItem[]-The rows, top to bottom: `{ id, label, href?, badge?, disabled? }`. A row with `href` renders as a link, otherwise as a button.
value string-Id of the current item. Bindable.
onValueChange (id: string) => void-Called with the id of an item that is activated and not already current.
preview Snippet<[TickNavItem]>-Content of the card that follows the pointer while a row is hovered (or sits beside a keyboard-focused row). Leave it out and no card is rendered.
reach number4Rows over which the neighbours of the hovered row still react.
minorTicks number2Ruler ticks drawn between two rows.
variant "default" | "neon""default"Neon turns the lines into glowing tubes: proximity raises the glow, a beam of light rides every pluck, labels glow on hover, and the current line breathes. Made for dark surfaces.
hdr booleantrueNeon only: on a display that reports HDR, draws the light in a WebGPU canvas with extended tone mapping, so the tubes reach SDR white and the beam peaks around 1000 nits. Elsewhere the CSS glow carries the effect alone.
ariaLabel string"Navigation"Accessible name of the nav landmark.
sound booleanfalsePlays a cue for every line a mouse or pen plucks (hover for an item, a softer tick for a ruler tick), once the user has enabled sound
class string-Additional CSS classes on the nav.