Shared Layout Background

Put it around a list of links or menu rows and a soft highlight follows whichever item is under the pointer, sliding from row to row through a shared layout animation and blurring in or out as you enter or leave the list.

Preview

Shared Layout Background preview width

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @karaui/shared-layout-bg
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

API Reference

as?
"div" | "ul"

Semantic container used for the children.

div
pillClassName?
string

Tailwind class applied to the moving pill. Defaults to a subtle foreground tint.

—
inset?
number

Horizontal inset of the pill relative to each row (px). Default 20.

20
pillContainerClassName?
string

Optional positioning override for the pill wrapper inside each item.

—
className?
string
—

Updated