Skip to content

Add DisplayMenu component#10

Merged
kualta merged 2 commits into
mainfrom
display-menu
Jul 16, 2026
Merged

Add DisplayMenu component#10
kualta merged 2 commits into
mainfrom
display-menu

Conversation

@kualta

@kualta kualta commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Promotes the flow.game menu's triplicated big-uppercase display nav button (MenuItem copies in web/menu/src/App.tsx, RoomsPage.tsx, and the SettingsPage.tsx Back button) into the shared library as DisplayMenu / DisplayMenuItem, so the flow.game SSR rewrite can consume one canonical implementation instead of three drifting copies.

API

  • DisplayMenu<nav> wrapper, flex flex-col items-start gap-1.5, accepts all nav props.
  • DisplayMenuItem — cva + useRender (same conventions as item.tsx/badge.tsx), renders a <button type="button"> by default or any element via the Base UI render prop (anchor, router Link, ...).
    • size: lg (text-2xl md:text-4xl, the rooms-page scale, default) | xl (text-6xl leading-none md:text-8xl, the home-menu scale)
    • trailing?: React.ReactNode — smaller baseline-aligned suffix (text-lg md:text-xl at lg, text-3xl md:text-4xl at xl, font-semibold text-muted-foreground), used for the Play preload percentage
    • disabled?: boolean — sets aria-disabled + data-disabled, native disabled when rendering the default <button>, swaps cursor-pointer hover:text-muted-foreground for cursor-default
    • base: uppercase, font-bold tracking-tight text-foreground, transition-[color] duration-200 ease-(--ease-out)
    • data-slot="display-menu" / "display-menu-item" / "display-menu-item-trailing"; displayMenuItemVariants exported alongside the components
  • Exported from src/components/ui/index.ts; version bumped 0.16.1 -> 0.17.0 per the component-add convention (add StatusWidget component #7).

Testing

  • bun run lint and bun run typecheck are both clean.
  • bun run dev -> Components page -> new "Display Menu" section at the bottom demos xl with a trailing 42% while disabled, default lg items, an anchor via render, and a disabled lg item (no hover shift, default cursor).

@kualta
kualta merged commit 069bb2f into main Jul 16, 2026
1 check passed
@kualta
kualta deleted the display-menu branch July 16, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant