# NavMenu

A navigation list, either a vertical sidebar or a horizontal tab bar, driven by a comma separated list. It raises `OnNavigate` when the user picks an item.

**License needed:** Standard. No premium connector, no PCF, no environment setting.

## Properties

| Property | Type | Default | Notes |
|---|---|---|---|
| Items | Text | Dashboard,Customers,Invoices,Settings | Comma separated |
| Selected | Text | Dashboard | Active item on open. Changing it resets the user's pick |
| Orientation | Text | Vertical | Vertical or Horizontal |
| AccentColor | Color | dark teal | Selected item color |
| ItemWidth | Number | 120 | Item width in the horizontal layout |
| SelectedItem (output) | Text | | The active item |
| OnNavigate (event) | | | Runs after a pick |

Width and Height are normal component properties (default 220 x 220).

## Setup

1. Create a component named `NavMenu` and paste `src/NavMenu.pa.yaml`.
2. Insert the component on every screen that needs navigation and set `Items`.
3. Set `OnNavigate` of the instance, for example `Navigate(Switch(NavMenu_1.SelectedItem, "Customers", CustomersScreen, DashboardScreen))`.
4. Keep `Selected` fixed per screen. Do not bind it to `SelectedItem` of the same instance.
5. See `demo/DemoNavMenu.pa.yaml` for both orientations.

## Limits

- Item names double as keys, so they must be unique and cannot contain a comma.
- No icons and no nested levels in this version.
