@material-ui/icons APIs
- ExpandMore
- Delete
- Close
- Visibility
- VisibilityOff
- Check
- Add
- Edit
- Search
- ExpandLess
- Settings
- Person
- Info
- Clear
- ExitToApp
- ArrowDropDown
- Home
- GitHub
- Warning
- ArrowBack
- SearchOutlined
- Done
- LocationOn
- PlayArrow
- Apps
- Brightness4
- Brightness7
- Description
- KeyboardArrowDown
- KeyboardArrowLeft
- KeyboardArrowRight
- MoreVert
- LocationCity
- Map
- Image
- AccountCircle
- InfoOutlined
- Create
- Block
- Replay
- AddCircle
- HomeRounded
- GetApp
- ChevronLeft
- ChevronRight
- CloudDownload
- CheckCircleOutline
- Send
- LockOpen
- Cancel
- NavigateNext
- AccountBox
- DragIndicator
- FavoriteBorderOutlined
- AccessTime
- DoneAll
- CheckCircle
- CropFree
- LockOutlined
- Undo
- Dashboard
- People
- PhotoLibrary
- HomeOutlined
- Group
- ArrowDropUp
- Remove
- ArrowUpward
- Save
- ArrowForward
- AttachFile
- Headset
- SignalCellularAlt
- ArrowForwardIos
- PlayCircleFilled
- AccessAlarm
- Adjust
- BarChart
- CloseRounded
- PlayArrowOutlined
- ImageRounded
- MenuBookRounded
- RefreshRounded
- HourglassEmptyOutlined
- Announcement
- Ballot
- QuestionAnswerOutlined
- CloudUpload
- SkipNext
- ArrowRightAlt
- MoreHoriz
- FileCopy
- MenuBook
- Language
- AlternateEmail
- FolderOpen
- Lock
- Pets
- AddCircleRounded
- ExploreRounded
- WbSunnyRounded
- Brightness2Rounded
- DonutLargeRounded
- AssistantRounded
- AccountCircleRounded
- ExitToAppRounded
- VpnKey
- MailOutline
- Smartphone
- DeleteForever
- LanguageOutlined
- Colorize
- SignalCellularConnectedNoInternet2Bar
- SignalCellularConnectedNoInternet0Bar
- SignalCellular4Bar
- DeleteOutline
- NewReleases
- LocalOffer
- Assessment
- Place
- TrendingDown
- ShoppingCart
- Stop
- RotateLeft
- Menu
- Flag
- Forum
- GroupSharp
- InsertEmoticon
- NotificationsActive
- PhoneIphone
- AllInbox
- Comment
- Photo
- PlaylistAddCheck
- CloudUploadRounded
- ExpandMoreOutlined
- History
- PersonOutlineOutlined
- ArrowForwardIosRounded
- ArrowBackIosRounded
- AssignmentOutlined
- VerticalAlignCenterOutlined
- CalendarTodayOutlined
- Error
- PlaylistPlay
- MusicNoteTwoTone
- Portrait
- ExploreOutlined
- DeleteRounded
- EditRounded
- SaveRounded
- CreateNewFolder
- MeetingRoom
- MenuOpenRounded
- MenuRounded
- DateRange
- CallEnd
- Assignment
- KeyboardBackspace
- BluetoothSearching
- CameraAlt
- PlaylistAdd
- Favorite
- Bluetooth
- OpenInBrowser
- Loop
- FileCopyOutlined
- NavigateBefore
- MergeType
- Dvr
- PersonOutline
- PlayCircleFilledWhiteOutlined
- StoreMallDirectoryOutlined
- SupervisedUserCircleOutlined
- MonetizationOn
- OpenInNew
- ArrowDownward
- AddBox
- FilterList
- FirstPage
- LastPage
- ViewColumn
- Notifications
- DriveEta
- LocalTaxi
- Redo
- AccountTree
- TextFields
- SaveAlt
- ThumbDown
- ThumbUp
- LocalPhone
- VolumeUp
- VolumeDown
- Translate
- AddCircleOutlined
- RemoveCircleOutlined
- Router
- RemoveRedEye
- Chat
- Mood
- Mic
OtherRelated APIs
- react#useState
- react#useEffect
- react#useContext
- @material-ui/core/styles#makeStyles
- @material-ui/core/styles#useTheme
- @material-ui/core/styles#alpha
- @material-ui/core#Typography
- @material-ui/core#Switch
- @material-ui/core#ListItem
- @material-ui/core#AppBar
- @material-ui/core#Toolbar
- @material-ui/core#List
- @material-ui/core#ListItemIcon
- @material-ui/core#ListItemText
- @material-ui/core#IconButton
- @material-ui/core#CssBaseline
- @material-ui/core#InputBase
- @material-ui/core#Drawer
- @material-ui/core#Hidden
- @material-ui/core#Divider
- @material-ui/icons#HomeRounded
@material-ui/icons#MenuBookRounded JavaScript Examples
The following examples show how to use
@material-ui/icons#MenuBookRounded.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: layout.jsx From animeworldz with MIT License | 4 votes |
function Layout({ window, children }) {
const theme = useTheme();
const classes = useStyles();
const history = useHistory();
const location = useLocation();
const [searchResult, setSearchResult] = useState([]);
const [time, setTime] = useState(new Date().toLocaleTimeString());
const { darkMode, setDarkMode } = useContext(DarkModeContext);
const [keyword, setKeyword] = useState("");
const [mobileOpen, setMobileOpen] = React.useState(false);
useEffect(() => {
setInterval(() => {
setTime(new Date().toLocaleTimeString());
}, 1000);
}, []);
const menuItems = [
{
text: "HomePage",
icon: <HomeRounded />,
path: "/",
},
{
text: "Waifu Pics",
icon: <ImageRounded />,
path: "/waifu",
},
];
const drawer = (
<div>
<div>
<Typography variant="h5" className={classes.title}>
ANIMEWORLD-Z
</Typography>
</div>
<Divider />
<List>
{menuItems.map((menu, i) => (
<ListItem
key={i}
button
onClick={() => history.push(menu.path)}
className={location.pathname === menu.path ? classes.active : null}
>
<ListItemIcon>{menu.icon}</ListItemIcon>
<ListItemText primary={menu.text} />
</ListItem>
))}
</List>
<div className={classes.footer}>
<Typography variant="h6" className={classes.version}>
v2.1
</Typography>
</div>
</div>
);
const handleSwitch = (event) => {
setDarkMode(event.target.checked);
};
const handleSearch = (event) => {
const { value } = event.target;
setKeyword(value);
};
const getSearchAnime = () => {
if (keyword) {
axios
.get(`/api/v1/anime/${keyword}`)
.then((response) => {
setSearchResult(response.data);
})
.catch((err) => console.log(err));
} else {
setSearchResult([]);
}
};
const handleDrawerToggle = () => {
setMobileOpen(!mobileOpen);
};
const handleResetKeyword = () => {
setKeyword("");
};
useEffect(() => {
let timer = setTimeout(() => getSearchAnime(), 1000);
return () => clearTimeout(timer);
}, [keyword]);
const container =
window !== undefined ? () => window().document.body : undefined;
return (
<div className={classes.root}>
<CssBaseline />
{keyword !== "" ? (
<SearchList
results={searchResult}
handleResetKeyword={handleResetKeyword}
/>
) : (
""
)}
<AppBar className={classes.appBar} color="dafault">
<Toolbar>
<IconButton
color="inherit"
aria-label="open drawer"
edge="start"
onClick={handleDrawerToggle}
className={classes.menuButton}
>
<MenuBookRounded />
</IconButton>
<Typography className={classes.time}>{time}</Typography>
<div className={classes.search}>
<div className={classes.searchIcon}>
<SearchOutlined />
</div>
<InputBase
placeholder="Search…"
classes={{
root: classes.inputRoot,
input: classes.inputInput,
}}
inputProps={{ "aria-label": "search" }}
onChange={handleSearch}
value={keyword}
/>
</div>
<Switch checked={darkMode} onChange={handleSwitch} />
</Toolbar>
</AppBar>
<nav className={classes.drawer}>
{/* The implementation can be swapped with js to avoid SEO duplication of links. */}
<Hidden smUp implementation="css">
<Drawer
container={container}
variant="temporary"
anchor={theme.direction === "rtl" ? "right" : "left"}
open={mobileOpen}
onClose={handleDrawerToggle}
classes={{
paper: classes.drawerPaper,
}}
ModalProps={{
keepMounted: true, // Better open performance on mobile.
}}
>
{drawer}
</Drawer>
</Hidden>
<Hidden xsDown implementation="css">
<Drawer
classes={{
paper: classes.drawerPaper,
}}
variant="permanent"
open
>
{drawer}
</Drawer>
</Hidden>
</nav>
<div className={classes.page}>
<div className={classes.toolbar}></div>
{children}
</div>
</div>
);
}