@material-ui/icons#Home TypeScript Examples
The following examples show how to use
@material-ui/icons#Home.
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: with-full-config.tsx From react-component-library with BSD 3-Clause "New" or "Revised" License | 5 votes |
withFullConfig = (): StoryFnReactReturnType => {
const classes = useStyles();
const direction = getDirection();
const appBarGroupId = 'AppBar';
const threeLinerGroupId = 'ThreeLiner';
// AppBar props
const animationDuration = number('animationDuration', 300, {}, appBarGroupId);
const showBackgroundImage = boolean('show backgroundImage', true, appBarGroupId);
const collapsedHeight = number('collapsedHeight', 64, {}, appBarGroupId);
const expandedHeight = number('expandedHeight', 200, {}, appBarGroupId);
const scrollThreshold = number('scrollThreshold', 136, {}, appBarGroupId);
const variant = select('variant', ['snap', 'collapsed', 'expanded'], 'snap', appBarGroupId);
// ThreeLiner props
const title = text('title', 'title', threeLinerGroupId);
const subtitle = text('subtitle', 'subtitle', threeLinerGroupId);
const info = text('info', 'info', threeLinerGroupId);
return (
<AppBar
expandedHeight={expandedHeight}
collapsedHeight={collapsedHeight}
scrollThreshold={scrollThreshold}
animationDuration={animationDuration}
backgroundImage={showBackgroundImage ? bgImage : undefined}
variant={variant}
classes={{ collapsed: classes.collapsed, expanded: classes.expanded }}
>
<Toolbar classes={{ gutters: direction === 'rtl' ? classes.toolbarGuttersRTL : classes.toolbarGutters }}>
<IconButton onClick={action('home icon clicked...')} color={'inherit'} edge={'start'}>
<Menu />
</IconButton>
<Spacer />
<ThreeLiner
classes={{ title: classes.title, subtitle: classes.subtitle, info: classes.info }}
className={clsx([classes.liner, direction === 'rtl' ? classes.linerRTL : ''])}
title={title}
subtitle={subtitle}
info={info}
animationDuration={animationDuration}
/>
<div style={{ display: 'flex', flexDirection: 'row' }}>
<IconButton onClick={action('home icon clicked...')} color={'inherit'}>
<Home />
</IconButton>
<IconButton onClick={action('work icon clicked...')} color={'inherit'}>
<Work />
</IconButton>
<IconButton onClick={action('settings icon clicked...')} color={'inherit'}>
<Settings />
</IconButton>
</div>
</Toolbar>
</AppBar>
);
}
Example #2
Source File: with-blui-app-bar.tsx From react-component-library with BSD 3-Clause "New" or "Revised" License | 5 votes |
withBluiAppBar = (): StoryFnReactReturnType => {
const classes = useStyles();
const direction = getDirection();
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down('xs'));
const appBarGroupId = 'AppBar';
const threeLinerGroupId = 'ThreeLiner';
const toolbarMenuGroupId = 'ToolbarMenu';
// AppBar props
const animationDuration = number('animationDuration', 300, {}, appBarGroupId);
const showBackgroundImage = boolean('show backgroundImage', true, appBarGroupId);
const collapsedDesktopHeight = number('collapsedDesktopHeight', 64, {}, appBarGroupId);
const collapsedMobileHeight = number('collapsedMobileHeight', 56, {}, appBarGroupId);
const expandedHeight = number('expandedHeight', 200, {}, appBarGroupId);
const scrollThreshold = number('scrollThreshold', 136, {}, appBarGroupId);
const variant = select('variant', ['snap', 'collapsed', 'expanded'], 'snap', appBarGroupId);
// ThreeLiner props
const title = text('title', 'title', threeLinerGroupId);
const info = text('info', 'info', threeLinerGroupId);
// ToolbarMenu props
const toolbarLabel = text('label', 'Subtitle', toolbarMenuGroupId);
return (
<>
<AppBar
expandedHeight={expandedHeight}
collapsedHeight={!isMobile ? collapsedDesktopHeight : collapsedMobileHeight}
scrollThreshold={scrollThreshold}
animationDuration={animationDuration}
backgroundImage={showBackgroundImage ? bgImage : undefined}
variant={variant}
classes={{ collapsed: classes.collapsed, expanded: classes.expanded }}
>
<Toolbar
classes={{ gutters: direction === 'rtl' ? classes.toolbarGuttersRTL : classes.toolbarGutters }}
>
<IconButton onClick={action('home icon clicked...')} color={'inherit'} edge={'start'}>
<Menu />
</IconButton>
<Spacer />
<ThreeLiner
classes={{ title: classes.title, subtitle: classes.subtitle, info: classes.info }}
className={clsx([classes.liner, direction === 'rtl' ? classes.linerRTL : ''])}
title={title}
subtitle={
<ToolbarMenu
classes={{ root: classes.toolbarMenuRoot }}
label={toolbarLabel}
menuGroups={menuGroups}
></ToolbarMenu>
}
info={info}
animationDuration={animationDuration}
/>
<div style={{ display: 'flex', flexDirection: 'row' }}>
<IconButton onClick={action('home icon clicked...')} color={'inherit'}>
<Home />
</IconButton>
<IconButton onClick={action('work icon clicked...')} color={'inherit'}>
<Work />
</IconButton>
<IconButton onClick={action('settings icon clicked...')} color={'inherit'}>
<Settings />
</IconButton>
</div>
</Toolbar>
</AppBar>
<div>{getBodyFiller()}</div>
</>
);
}