-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs] document use of theme.mixins.toolbar & <Toolbar /> when using Appbar variant fixed #17878
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That semicolon should be a colon right? |
||
|
||
```jsx | ||
const useStyles = makeStyles(theme => ({ | ||
offset: { | ||
...theme.mixins.toolbar, | ||
flexGrow: 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need flexGrow in this case? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no |
||
} | ||
})) | ||
|
||
const App = () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think of adding an plain example (to remove and source of doubt and to avoid having to dig in the following demo)? |
||
|
||
### Hide App Bar | ||
|
||
The app bar hides on scroll down to leave more space for reading. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we tend to use & in the docs @mbrookes ?