<BaseActionComponent />


# <BaseActionComponent />

Component which renders all the default and custom actions for both the Resource and the Record.

It passes all props down to the actual Action component.

Example of creating your own actions:

// AdminBro options
const AdminBroOptions = {
  resources: [
     options: {
       actions: {
          myNewAction: {
            label: 'amazing action',
            icon: 'Add',
            inVisible: (resource, record) => record.param('email') !== '',
            actionType: 'record',
            component: AdminBro.bundle('./my-new-action'),
            handler: (request, response, data) => {
              return {
// ./my-new-action.jsx
import { Box } from 'admin-bro'

const MyNewAction = (props) => {
  const { resource, action, record } = props
  // do something with the props and render action
  return (
    <Box>Some Action Content</Box>

View Source admin-bro/src/frontend/components/app/base-action-component.tsx, line 9

Type Definitions


# ActionProps

Props which are passed to all action components

Name Type Attributes Description
action ActionJSON

Action object describing the action

resource ResourceJSON

Object of type: ResourceJSON

record RecordJSON <optional>

Selected record. Passed for actions with "record" actionType

records Array.<RecordJSON> <optional>

Selected records. Passed for actions with "bulk" actionType

setTag Dispatch.<SetStateAction.<string>> <optional>

Sets tag in a header of an action. It is a function taking tag as an argument

View Source admin-bro/src/frontend/components/actions/action.props.ts, line 5


Proudly built and maintained by SoftwareBrothers

Software House with a passion for both JavaScript and TypeScript.

See what we do See what we believe in

Proudly built and maintained by