File size: 1,556 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Sidebar Navigator Components

A collection of components designed to create a navigational sidebar using the experimental Navigator components from the WordPress package.

## Components

### SidebarNavigator

Main container for the navigator.

**Props:**

- `initialPath`: The initial path of the navigator.
- `children`: Children to render inside the navigator.

### SidebarNavigatorMenu

A container for navigational menu items.

**Props:**

- `description`: Description of the menu.
- `backButtonProps`:
  - `icon`: Icon for the back button.
  - `label`: Text label for the back button.
  - `onClick`: Callback when the back button is clicked.
- `path`: Path for the navigator screen.
- `children`: Children to render inside the menu.

### SidebarNavigatorMenuItem

A component representing an individual menu item.

**Props:**

- `icon`: Icon for the menu item.
- `path`: Path for the navigator.
- `link`: URL link for the menu item.
- `title`: Text for the menu item.
- `onClickMenuItem`: Callback when the menu item is clicked.
- `withChevron`: If true, a chevron icon is shown.
- `isExternalLink`: If true, an external link icon is shown.
- `isSelected`: If true, the menu item appears as selected.

## Usage

```jsx
<SidebarNavigator initialPath="/initial-path">
	<SidebarNavigatorMenu path="/menu-path" description="My Menu">
		<SidebarNavigatorMenuItem
			icon={ SampleIcon }
			path="/item-path"
			link="/item-link"
			title="Menu Item 1"
			onClickMenuItem={ handleClick }
			isSelected
		/>
	</SidebarNavigatorMenu>
</SidebarNavigator>
```