Skip to content

RowAction

RowAction = object

Defined in: packages/admin/src/types.ts:131

A custom action that appears on each row in a table’s list view.

Row actions are invoked with the record’s primary key and the form data from the admin action handler.

const publishAction: RowAction = {
label: "Publish",
action: async (id, formData) => {
await db.update(posts).set({ published: true }).where(eq(posts.id, id));
},
confirm: "Are you sure you want to publish this post?",
variant: "default",
};

action: (id, formData) => Promise<unknown>

Defined in: packages/admin/src/types.ts:135

Async handler called with the record ID and the submitted form data.

string

FormData

Promise<unknown>


optional confirm: string

Defined in: packages/admin/src/types.ts:137

Optional confirmation message. When set, the admin shows a confirm dialog before executing.


label: string

Defined in: packages/admin/src/types.ts:133

Display label for the action button.


optional variant: "danger" | "default"

Defined in: packages/admin/src/types.ts:139

Button styling variant. "danger" renders a destructive-style button. Defaults to "default".