Skip to content

CreateButton

Navigates to the create page for the curren resource.

Use the button without form when in a ResourceContext (e.g., inside a <List>):

import { CreateButton, List, ExportButton } from '@/components/admin';
const PostList = () => (
<List
actions={<>
<CreateButton />
<ExportButton />
</>}
>
...
</List>
);

Clicking on the button navigates to the create route of the current resource (e.g., /posts/create).

PropRequiredTypeDefaultDescription
labelOptionalstringra.action.createi18n key / custom label
resourceOptionalstringFrom contextTarget resource for create route