Skip to main content
Version: v3.0

Actions

The index page actions by default is simply the create action which transfers to the create pagek. You can add alter actions on the index page by manipulating the ModelIndexActions component.

Change the text of the create button

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

const rhinoConfig = {
version: 1,
components: {
ModelIndexActions: <ModelIndexActionsBase overrides={{ ModelIndexActionCreate: (<ModelIndexActionCreate>New Blog</ModelIndexActionCreate>)}} />
}
}

Change the icon of the create button

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

const rhinoConfig = {
version: 1,
components: {
ModelIndexActions: <ModelIndexActionsBase overrides={{ ModelIndexActionCreate: (<ModelIndexActionCreate icon="plus-circle"/>)}} />
}
}

Replace the default action

You can replace the default action with custom actions.

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

Prepend actions

You can prepend one or more actions to the defaults.

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

Append actions

You can append one or more actions to the defaults.

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

Remove all actions

You can append one or more actions to the defaults.

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

Create with a modal

Instead of creating on a separate page, you can create with a modal.

const rhinoConfig = {
version: 1,
components: {
ModelIndexActions: ModelIndexActionsModalCreate
}
}