-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
146 changed files
with
13,233 additions
and
4,391 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
docs/examples/sidenavigation/groupLinkDisplayExpadable.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import React, { useState } from 'react'; | ||
import { Box, SideNavigation } from 'gestalt'; | ||
|
||
export default function Example() { | ||
const [page, setPage] = useState('1'); | ||
|
||
return ( | ||
<Box height="100%" width={280}> | ||
<SideNavigation accessibilityLabel="Nested items example" showBorder> | ||
<SideNavigation.Group | ||
active={page === '1' ? 'page' : undefined} | ||
href="#" | ||
icon="people" | ||
label="Christmas" | ||
onClick={({ event }) => { | ||
event.preventDefault(); | ||
setPage('1'); | ||
}} | ||
> | ||
<SideNavigation.NestedItem | ||
active={page === '2' ? 'page' : undefined} | ||
href="#" | ||
label="Luxury Christmas" | ||
onClick={({ event }) => { | ||
event.preventDefault(); | ||
setPage('2'); | ||
}} | ||
/> | ||
<SideNavigation.NestedGroup | ||
active={page === '3' ? 'page' : undefined} | ||
href="#" | ||
label="Classic Christmas" | ||
onClick={({ event }) => { | ||
event.preventDefault(); | ||
setPage('3'); | ||
}} | ||
> | ||
<SideNavigation.NestedItem | ||
active={page === '4' ? 'page' : undefined} | ||
href="#" | ||
label="West Coast" | ||
onClick={({ event }) => { | ||
event.preventDefault(); | ||
setPage('4'); | ||
}} | ||
/> | ||
</SideNavigation.NestedGroup> | ||
<SideNavigation.NestedItem | ||
active={page === '5' ? 'page' : undefined} | ||
href="#" | ||
label="Luxury Christmas" | ||
onClick={({ event }) => { | ||
event.preventDefault(); | ||
setPage('5'); | ||
}} | ||
/> | ||
</SideNavigation.Group> | ||
</SideNavigation> | ||
</Box> | ||
); | ||
} |
Oops, something went wrong.