-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs][material-ui][Breadcrumbs] Document CondensedWithMenu option fo…
…r Material UI Breadcrumbs (#42973) Co-authored-by: ZeeshanTamboli <[email protected]>
- Loading branch information
1 parent
f5179dd
commit e727062
Showing
3 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
docs/data/material/components/breadcrumbs/CondensedWithMenu.js
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,51 @@ | ||
import * as React from 'react'; | ||
import Breadcrumbs from '@mui/material/Breadcrumbs'; | ||
import Link from '@mui/material/Link'; | ||
import Menu from '@mui/material/Menu'; | ||
import MenuItem from '@mui/material/MenuItem'; | ||
import IconButton from '@mui/material/IconButton'; | ||
import MoreHorizIcon from '@mui/icons-material/MoreHoriz'; | ||
|
||
export default function CondensedWithMenu() { | ||
const [anchorEl, setAnchorEl] = React.useState(null); | ||
const open = Boolean(anchorEl); | ||
|
||
const handleClick = (event) => { | ||
if (event) { | ||
setAnchorEl(event.currentTarget); | ||
} | ||
}; | ||
|
||
const handleClose = () => { | ||
setAnchorEl(null); | ||
}; | ||
|
||
return ( | ||
<React.Fragment> | ||
<Menu | ||
anchorEl={anchorEl} | ||
open={open} | ||
onClose={handleClose} | ||
aria-labelledby="with-menu-demo-breadcrumbs" | ||
> | ||
<MenuItem onClick={handleClose}>Breadcrumb 2</MenuItem> | ||
<MenuItem onClick={handleClose}>Breadcrumb 3</MenuItem> | ||
<MenuItem onClick={handleClose}>Breadcrumb 4</MenuItem> | ||
</Menu> | ||
<Breadcrumbs aria-label="breadcrumbs"> | ||
<Link color="primary" href="#condensed-with-menu"> | ||
Breadcrumb 1 | ||
</Link> | ||
<IconButton color="primary" size="small" onClick={handleClick}> | ||
<MoreHorizIcon /> | ||
</IconButton> | ||
<Link color="primary" href="#condensed-with-menu"> | ||
Breadcrumb 5 | ||
</Link> | ||
<Link color="primary" href="#condensed-with-menu"> | ||
Breadcrumb 6 | ||
</Link> | ||
</Breadcrumbs> | ||
</React.Fragment> | ||
); | ||
} |
51 changes: 51 additions & 0 deletions
51
docs/data/material/components/breadcrumbs/CondensedWithMenu.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,51 @@ | ||
import * as React from 'react'; | ||
import Breadcrumbs from '@mui/material/Breadcrumbs'; | ||
import Link from '@mui/material/Link'; | ||
import Menu from '@mui/material/Menu'; | ||
import MenuItem from '@mui/material/MenuItem'; | ||
import IconButton from '@mui/material/IconButton'; | ||
import MoreHorizIcon from '@mui/icons-material/MoreHoriz'; | ||
|
||
export default function CondensedWithMenu() { | ||
const [anchorEl, setAnchorEl] = React.useState<HTMLButtonElement | null>(null); | ||
const open = Boolean(anchorEl); | ||
|
||
const handleClick = (event: React.MouseEvent<HTMLButtonElement> | null) => { | ||
if (event) { | ||
setAnchorEl(event.currentTarget); | ||
} | ||
}; | ||
|
||
const handleClose = () => { | ||
setAnchorEl(null); | ||
}; | ||
|
||
return ( | ||
<React.Fragment> | ||
<Menu | ||
anchorEl={anchorEl} | ||
open={open} | ||
onClose={handleClose} | ||
aria-labelledby="with-menu-demo-breadcrumbs" | ||
> | ||
<MenuItem onClick={handleClose}>Breadcrumb 2</MenuItem> | ||
<MenuItem onClick={handleClose}>Breadcrumb 3</MenuItem> | ||
<MenuItem onClick={handleClose}>Breadcrumb 4</MenuItem> | ||
</Menu> | ||
<Breadcrumbs aria-label="breadcrumbs"> | ||
<Link color="primary" href="#condensed-with-menu"> | ||
Breadcrumb 1 | ||
</Link> | ||
<IconButton color="primary" size="small" onClick={handleClick}> | ||
<MoreHorizIcon /> | ||
</IconButton> | ||
<Link color="primary" href="#condensed-with-menu"> | ||
Breadcrumb 5 | ||
</Link> | ||
<Link color="primary" href="#condensed-with-menu"> | ||
Breadcrumb 6 | ||
</Link> | ||
</Breadcrumbs> | ||
</React.Fragment> | ||
); | ||
} |
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