Skip to main content
Version: v3.0

Actions

The create page (and modal) actions by default include a save button which creates the resource and returns to the show page of the newly created resource.

Change the text of the save button​

The text of the save button can be changed by passing in a child component.

const rhinoConfig = {
version: 1,
components: {
ModelCreateActions: <ModelCreateActionsBase overrides={{ModelCreateActionSave: <ModelCreateActionSave>Keep Forever</ModelCreateActionSave>}} />
}
}

Change the icon of the save button​

The icon of the save button can be changed by passing in an icon name.

const rhinoConfig = {
version: 1,
components: {
ModelCreateActions: <ModelCreateActionsBase overrides={{ModelCreateActionSave: <ModelCreateActionSave icon="life-preserver" />}} />
}
}

Add a cancel action​

A cancel action which returns to the index page can be added:

const rhinoConfig = {
version: 1,
components: {
ModelCreateActions: { props: { hasCancel: true } }
}
}

Change the text of the cancel button​

The text of the cancel button can be changed by passing in a child component.

const rhinoConfig = {
version: 1,
components: {
ModelCreateActions: <ModelCreateActionsBase overrides={{ModelCreateActionCancel: <ModelCreateActionCancel>No Way</ModelCreateActionCancel>}} hasCancel />
}
}

Change the icon of the cancel button​

The icon of the cancel button can be changed by passing in an icon name.

const rhinoConfig = {
version: 1,
components: {
ModelCreateActions: <ModelCreateActionsBase overrides={{ModelCreateActionCancel: <ModelCreateActionCancel icon="x-octagon" />}} hasCancel />
}
}

Replace the default actions​

You can replace the default actions with custom actions.

const rhinoConfig = {
version: 1,
components: {
ModelCreateActions: { props: { actions: [<MyCustomAction />]} }
}
}

Prepend actions​

You can prepend one or more actions to the defaults.

const rhinoConfig = {
version: 1,
components: {
ModelCreateActions: { props: { prepend: true, actions: [<MyCustomAction />]} }
}
}

Append actions​

You can append one or more actions to the defaults.

const rhinoConfig = {
version: 1,
components: {
ModelCreateActions: { props: { append: true, actions: [<MyCustomAction />]} }
}
}

Remove all actions​

You can append one or more actions to the defaults.

const rhinoConfig = {
version: 1,
components: {
ModelCreateActions: null
}
}

Add a "Save & Add Another" button​

And addition "Save & Add Another" button can be added to allow users to create another resource of the same type.

const rhinoConfig = {
version: 1,
components: {
ModelCreateActions: { props: { append: true, actions: [<ModelCreateActionSaveAnother />]} }
}
}