MCPcopy Create free account
hub / github.com/pinterest/gestalt / Example

Function Example

docs/examples/sidenavigation/nestedExample.tsx:4–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import { Box, SideNavigation } from 'gestalt';
3
4export default function Example() {
5 return (
6 <Box height="100%" width={300}>
7 <SideNavigation accessibilityLabel="Nested items example">
8 <SideNavigation.TopItem
9 href="#"
10 icon="ads-stats"
11 label="Reporting"
12 onClick={({ event }) => event.preventDefault()}
13 />
14 <SideNavigation.TopItem
15 href="#"
16 icon="replace"
17 label="Conversions"
18 onClick={({ event }) => event.preventDefault()}
19 />
20 <SideNavigation.Section label="Audiences">
21 <SideNavigation.TopItem
22 href="#"
23 icon="people"
24 label="Thanksgiving"
25 onClick={({ event }) => event.preventDefault()}
26 />
27
28 <SideNavigation.Group icon="people" label="Christmas">
29 <SideNavigation.NestedItem
30 href="#"
31 label="Luxury Christmas"
32 onClick={({ event }) => event.preventDefault()}
33 />
34
35 <SideNavigation.NestedGroup label="Classic Christmas">
36 <SideNavigation.NestedItem
37 href="#"
38 label="West Coast"
39 onClick={({ event }) => event.preventDefault()}
40 />
41 <SideNavigation.NestedItem
42 href="#"
43 label="East Coast"
44 onClick={({ event }) => event.preventDefault()}
45 />
46 </SideNavigation.NestedGroup>
47
48 <SideNavigation.NestedGroup label="Alternative Christmas">
49 <SideNavigation.NestedItem
50 active="section"
51 href="#"
52 label="West Coast"
53 onClick={({ event }) => event.preventDefault()}
54 />
55 <SideNavigation.NestedItem
56 href="#"
57 label="East Coast"
58 onClick={({ event }) => event.preventDefault()}
59 />
60 </SideNavigation.NestedGroup>
61 </SideNavigation.Group>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected