Skip to main content

<CreateButton>

CreateButton navigates to the create page for the current resource. It renders only when the resource has hasCreate set (i.e. a <Resource> with a create prop). It is typically placed in the actions area of a <List>.

Usage

import { CreateButton } from '@strato-admin/cloudscape';

// Inside a List — resource is inferred from context
<List actions={<CreateButton />}>...</List>;

The button label defaults to the translated string for strato.action.create ("Create"). Pass label to override it.

<CreateButton label="New product" />

Specifying a resource

By default CreateButton reads the resource from the current resource context. You can override it explicitly:

<CreateButton resource="products" />

Changing the variant

The default variant is primary. Use normal for a secondary-style button.

<CreateButton variant="normal" />

Props

PropTypeDefaultDescription

label

Type: string Default: translated "Create"

Override the button label. Useful when a more descriptive call-to-action is needed (e.g. "Add product").

variant

Type: 'primary' | 'normal' | 'link' Default: 'primary'

Controls the Cloudscape button style. Use 'primary' when this is the dominant action on the page, 'normal' when it sits alongside other primary actions.