Radial Nav
ComponentsRadial Nav
NavigationNew

Radial Nav

A constellation of destinations around one central idea. Open up and choose a direction.

React + CSS
Live component. Go ahead, interact.
01

Installation

Run this in your shadcn-configured React project. The component and stylesheet are added together.

TERMINAL
npx shadcn@latest add http://localhost:5173/r/radial-nav.json

This command uses the current site address. For localhost, keep this preview running on the same computer. Files follow your configured components alias.

02

Usage

Import the component and make the details your own.

TypeScript
import { RadialNav } from '@/components/anticraft/RadialNav';

export function Example() {
  const icon = <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5"><path d="M5 19 19 5M5 5h14v14" /></svg>;
  return (
    <RadialNav
      label="Explore"
      activeId="work"
      items={[
        { id: 'work', label: 'Work', href: '/#work', icon },
        { id: 'about', label: 'About', href: '/#about', icon },
        { id: 'journal', label: 'Journal', href: '/#journal', icon },
        { id: 'contact', label: 'Contact', href: '/#contact', icon },
      ]}
    />
  );
}
03

Props

PropTypeDefaultDescription
itemsRadialNavItem[]RequiredDestinations with a unique id, visible label, and real href. Replace the example URLs with destinations in your project.
activeIdstringundefinedThe controlled id of the current destination. Only that link receives aria-current="page". Update this from your route or selected section.
labelstring'Explore'The accessible navigation label. Disclosure components also use it for their visible trigger.
onNavigate(id: string, event: MouseEvent<HTMLAnchorElement>) => voidundefinedRuns when a destination is activated. Anchors navigate normally; call event.preventDefault() only when handling navigation yourself, such as a local preview or router adapter.
classNamestring''Additional classes for sizing and CSS custom properties. Each component imports its matching stylesheet; keep both files together.
items[].iconReactNodeRequiredDecorative artwork for a destination. Use short labels and a small group of destinations so links have room around the orbit.
onOpenChange(open: boolean) => voidundefinedReceives changes to the internal disclosure state when visitors open, dismiss, or navigate.
04

Motion & accessibility

Considered by default.

Click or tap the center to reveal the destinations. Enter and Space operate its native button. Arrow keys open the orbit and move between links; Home and End reach its edges. Tab also follows the normal document order. Escape closes and restores trigger focus; outside presses, focus leaving, and link activation dismiss it. Closed links are hidden from interaction and assistive technology. Reduced motion reveals the links without radial animation. Set --ac-radial-height for the stage and --ac-surface, --ac-ink, and --ac-accent for its palette.

Use semantic content and meaningful labels in your composition. Check contrast and keyboard behavior with your own styles and content.