4

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

enter image description here

2 Answers2

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: