Skip to main content
Version: v3.0

Actions

The edit page (and modal) actions by default include a save button which saves the resource and returns to the show page of the 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: {
ModelEditActions: <ModelEditActionsBase overrides={{ModelEditActionSave: <ModelEditActionSave>Keep Forever</ModelEditActionSave>}} />
}
}

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: {
ModelEditActions: <ModelEditActionsBase overrides={{ModelEditActionSave: <ModelEditActionSave icon="life-preserver" />}} />
}
}

Add a cancel action​

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

const rhinoConfig = {
version: 1,
components: {
ModelEditActions: { 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: {
ModelEditActions: <ModelEditActionsBase overrides={{ModelEditActionCancel: <ModelEditActionCancel>No Way</ModelEditActionCancel>}} 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: {
ModelEditActions: <ModelEditActionsBase overrides={{ModelEditActionCancel: <ModelEditActionCancel icon="x-octagon" />}} hasCancel />
}
}

Replace the default actions​

You can replace the default actions with custom actions.

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

Prepend actions​

You can prepend one or more actions to the defaults.

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

Append actions​

You can append one or more actions to the defaults.

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

Remove all actions​

You can append one or more actions to the defaults.

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