Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the title on each page custom in react-admin

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

like image 716
Sohrab Nasr Avatar asked Oct 15 '25 04:10

Sohrab Nasr


1 Answers

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

like image 195
gstvg Avatar answered Oct 16 '25 19:10

gstvg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!