Skip to content

Commit

Permalink
[docs] document use of theme.mixins.toolbar & <Toolbar /> when using …
Browse files Browse the repository at this point in the history
…Appbar variant fixed (#17878)
  • Loading branch information
adeelibr authored and eps1lon committed Oct 15, 2019
1 parent e55e2d5 commit 032f7e9
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/src/pages/components/app-bar/app-bar.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,33 @@ A side searchbar.

You can use the `useScrollTrigger()` hook to respond to user scroll actions.

## Placement

When using Appbar `variant="fixed"` you need to have extra space for the content to show below
& not under. There are 2 ways to do it. Either use `theme.mixins.toolbar` like;

```jsx
const useStyles = makeStyles(theme => ({
offset: {
...theme.mixins.toolbar,
flexGrow: 1
}
}))

const App = () => {
const classes = useStyles();
return (
<div>
<Appbar position="fixed"></Appbar>
<div className={classes.offset}> {/* to accomdate for top white space */}
</div>
)
};
```

Or you can append `<Toolbar />` component after `<Appbar />` like shown in the example
below. To prevent content from hiding under Appbar.

### Hide App Bar

The app bar hides on scroll down to leave more space for reading.
Expand Down

0 comments on commit 032f7e9

Please sign in to comment.