Skip to content
Pixelbits
Docs / Full-screen menu
Signature

Full-screen menu

The portfolio's full-screen menu: a modal of large cells; hovering or focusing a cell dissolves it to the ink color while its label rolls up. Built on a native <dialog> (focus trap, Escape, top layer), with links inside a <nav>.

Installation

npm: import
import { FullScreenMenu } from "pixelbits/full-screen-menu";
shadcn: copy the source
npx shadcn add https://pixelbits.ali-moradi-develop.com/r/full-screen-menu.json

API

<FullScreenMenu>

The portfolio's full-screen menu: a modal of large cells; hovering or focusing a cell dissolves it to the ink color while its label rolls up. Built on a native <dialog> (focus trap, Escape, top layer), with links inside a <nav>.

Example
<FullScreenMenu
  trigger={<Button size="sm">Menu</Button>}
  brand={<Logo />}
  links={[{ label: "Work", href: "/work" }, { label: "Studio", href: "/studio" }]}
/>
PropTypeDefaultDescription
links*MenuLink[]—

The destinations, shown as large cells in a grid.

trigger*ReactElement—

The element that opens the menu, usually a Button ("Menu").

openboolean—

Whether it is open (controlled).

defaultOpenbooleanfalse

Open on first render (uncontrolled).

onOpenChange(open: boolean) => void—

Called when it opens or closes.

brandReactNode—

Content of the top bar on the start side, usually the logo.

footerReactNode—

Content under the grid: contact details, social links.

columns1 | 2 | 32

Cells per row on wide screens (one per row on phones).

renderLink(link: MenuLink, props: { className: string—

Render links with your router's component, e.g. (link, props) => <NextLink href={link.href} {...props} />.

labelstring"Menu"

Accessible name of the menu dialog.

classNamestring—

Extra classes for the root element.