afraid-scarlet
afraid-scarlet3mo ago

Create

How can i Switch the name of the "Create" Button?
No description
2 Replies
kapa.ai
kapa.ai3mo ago
Hi @nico. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- To switch the name of the "Create" button in refine, you can customize the header buttons on pages like List, Show, Create, and Edit. This can be done by using the headerButtons property, which allows you to modify the default buttons. Here's an example using Material-UI:
import { List, CreateButton } from "@refinedev/mui";
import { Button } from "@mui/material";

const PostList: React.FC = () => {
return (
<List
headerButtons={({ createButtonProps }) => (
<>
{createButtonProps && (
<CreateButton
{...createButtonProps}
>
Custom Text
</CreateButton>
)}
</>
)}
>
<span>Rest of your page here</span>
</List>
);
};
import { List, CreateButton } from "@refinedev/mui";
import { Button } from "@mui/material";

const PostList: React.FC = () => {
return (
<List
headerButtons={({ createButtonProps }) => (
<>
{createButtonProps && (
<CreateButton
{...createButtonProps}
>
Custom Text
</CreateButton>
)}
</>
)}
>
<span>Rest of your page here</span>
</List>
);
};
In this example, the CreateButton is customized to display "Custom Text" instead of the default "CREATE" text. You can adjust the text to whatever you prefer. For more details, you can refer to the GitHub issue discussion (https://github.com/refinedev/refine/issues/3769) where this feature was addressed. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@529992799349899264> kapa.ai is still learning and improving, please let us know how it did by reacting below

Did you find this page helpful?