Skip to content
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] Demo how to use a specific slide direction for Snackbar #28211

Merged
merged 1 commit into from
Sep 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion docs/src/pages/components/snackbars/snackbars.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Snackbars should appear above FABs (on mobile).

{{"demo": "pages/components/snackbars/FabIntegrationSnackbar.js", "iframe": true, "maxWidth": 400}}

### Change Transition
### Change transition

[Grow](/components/transitions/#grow) is the default transition but you can use a different one.

Expand All @@ -71,6 +71,22 @@ Snackbars should appear above FABs (on mobile).

You can change the direction of the [Slide](/components/transitions/#slide) transition.

Example of making the slide transition to the left:

```jsx
import Slide from '@material-ui/core/Slide';

function TransitionLeft(props) {
return <Slide {...props} direction="left" />;
}

export default function MyComponent() {
return <Snackbar TransitionComponent={TransitionLeft} />;
}
```

Other examples:

{{"demo": "pages/components/snackbars/DirectionSnackbar.js"}}

## Complementary projects
Expand Down