logo

Aki UI

アキ ウイ

Morphic Navbar

モーフィックナビバー

Every link sits in one solid slab; the current one pulls away from it with a margin and rounds all four corners, while the two links it left behind round the corner they have just exposed. Nothing moves except border-radius and a margin, both under a single transition, which is why the row reads as one shape reflowing rather than four buttons repainting. The active link carries aria-current, so the state is not only in the geometry. The original glass surface is dropped for a flat slab. Adapted from Kokonut UI under the MIT licence.

Installation

Copy and paste the following code into a new component file:1

"use client"

/**
* Adapted for Aki UI from Kokonut UI's Morphic Navbar.
* Original author: @dorianbaffier — https://kokonutui.com
* Copyright (c) 2025 kokonutUI, MIT License.
* https://github.com/kokonut-labs/kokonutui
*
* Reworked here onto the local palette, with clsx replaced by the local cn
* helper and the glass surface dropped for a flat slab.

How to use it2

"use client"

import { MorphicNavbar } from "@/components/ui/morphic-navbar"

const items = [
{ href: "/", label: "home" },
{ href: "/works", label: "works" },
{ href: "/blog", label: "blog" },
{ href: "/about", label: "about" },
]

Props

MorphicNavbar

NameDefaultDescription
items

NavItem[]

Links in the order they appear

defaultHreffirst item

string

Which link starts active. The active link is tracked in state, so pass the current route back through onNavigate if your router owns it

onNavigate

(href: string) => void

Fired when a link is clicked

darkfalse

boolean

Render the dark palette

NavItem

NameDefaultDescription
href

string

Route the link points at, also its key

label

string

Text inside the link