You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/Theming.md
+15-2
Original file line number
Diff line number
Diff line change
@@ -740,9 +740,22 @@ const App = () => (
740
740
741
741
## Replacing The AppBar
742
742
743
-
For more drastic changes of the top component, you will probably want to create an `<AppBar>` from scratch instead of just passing children to react-admin's `<AppBar>`.
743
+
By default, React-admin uses [Material-ui's `<AppBar>`component](https://material-ui.com/api/app-bar/) together with a custom container that internally uses a [Slide](https://material-ui.com/api/slide)to hide the `AppBar` on scroll. Here is an example of how to change this container with any component:
744
744
745
-
By default, React-admin uses [Material-ui's `<AppBar>` component](https://material-ui.com/api/app-bar/) together with [react-headroom](https://github.com/KyleAMathews/react-headroom) to hide the `AppBar` on scroll. Here is an example top bar rebuilt from scratch to remove the "headroom" effect:
745
+
```jsx
746
+
// in src/MyAppBar.js
747
+
import*asReactfrom'react';
748
+
import { Fragment } from'react';
749
+
import { AppBar } from'react-admin';
750
+
751
+
constMyAppBar=props=> (
752
+
<AppBar {...props} container={Fragment} />
753
+
);
754
+
755
+
exportdefaultMyAppBar;
756
+
```
757
+
758
+
For more drastic changes of the top component, you will probably want to create an `<AppBar>` from scratch instead of just passing children to react-admin's `<AppBar>`. Here is an example top bar rebuilt from scratch:
0 commit comments