Tinyrack

Menubar

Coordinate horizontal application menus with arrow-key movement and cascading items.

Coordinate horizontal application menus with arrow-key movement and cascading items.

Contract

AxisContract
CompositionTRMenubar lays out ordered TRMenubarMenu entries horizontally. Each entry owns one trigger and one popup child list.
KeyboardMaterial menu traversal coordinates arrow keys across top-level triggers and nested submenus. Escape closes the active cascade.
AvailabilitySet enabled: false on one TRMenubarMenu to remove its commands without disabling sibling menus.
Nested layersPlace TRMenuSubmenu entries inside menuChildren; each nested popup keeps its own bordered layer surface.

Give the menubar a semanticLabel that names the command group. Menubar and active triggers are borderless; popup layers retain their border, while focused items use a background highlight without changing border geometry.

Install

Add the package, then import its public library.

flutter pub add tinyrack_ui
import 'package:tinyrack_ui/tinyrack_ui.dart';

Playground

Usage

import 'package:material_ui/material_ui.dart';
import 'package:tinyrack_ui/tinyrack_ui.dart';

TRMenubar(
  semanticLabel: 'Application menu',
  menus: [
    TRMenubarMenu(
      trigger: const Text('File'),
      menuChildren: [
        TRMenuItem(onPressed: createRack, child: const Text('New rack')),
        TRMenuItem(onPressed: openRack, child: const Text('Open')),
      ],
    ),
  ],
)

Examples

API

TRMenubar properties

PropType / defaultPurpose
menusList<TRMenubarMenu> · requiredDefines the ordered top-level menus.
semanticLabelString? · nullNames the application command group for assistive technology.
uiSizeTRUiSize · TRUiSize.mdSets the control size every menu in this bar resolves by default. Use TRUiSize.sm for dense application chrome such as a title bar.

TRMenubarMenu properties

PropType / defaultPurpose
triggerWidget · requiredRenders the top-level menu label.
menuChildrenList<Widget> · requiredProvides commands, settings, separators, and nested submenus for the popup.
enabledbool · trueControls whether the trigger can open its menu.
controllerMenuController? · nullLets the parent open, close, or inspect this menu.
focusNodeFocusNode? · nullLets the parent coordinate focus for the top-level trigger.
onOpen / onCloseVoidCallback? · nullReports this menu opening and closing.
uiSizeTRUiSize? · nullOverrides the size the enclosing bar resolves for this trigger. Leave it unset so the bar keeps one size across its menus.