I want to change the title on each page to custom in React-Admin Is there a specific property in the Recorse or list or edit or create composites? please guide me Thanks
Asked
Active
Viewed 1,906 times
4
-
Can you tell us what you've tried so far please – Ameer Apr 24 '20 at 14:26
2 Answers
4
List, Show, Create and Update components all accept title prop, it can be either a string, or an element of your own.
<List {...props} title="My custom title">
...
</List>
or
const PostTitle = props => {
return <span>Post {props.record ? `"${props.record.title}"` : ''}</span>;
};
export const PostShow = (props) => (
<Show title={<PostTitle />} {...props}>
...
</Show>
);
If you wanna change the name in the menu, you can pass options prop with label to Resource:
<Resource ... options={{label: "Custom menu name"}}>
For multillingual apps, this is accomplished with the i18nProvider prop on Admin

gstvg
- 889
- 4
- 10
0
If you want to set page titles for web browsers, or any other properties on <head>
block, you can use react-helmet.
<Helmet>
<title>New page title</title>
</Helmet>
Here some references:
- How to Use React Helmet – With Example Use Case
- What is React Helmet and Where To Use It
- Dynamic window title #5893 (github discussion about use helmet on react-admin framework to set header titles).

Andre Bellafronte
- 71
- 6