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.
Example
Section titled “Example”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",};Properties
Section titled “Properties”action()
Section titled “action()”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.
Parameters
Section titled “Parameters”string
formData
Section titled “formData”FormData
Returns
Section titled “Returns”Promise<unknown>
confirm?
Section titled “confirm?”
optionalconfirm: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.
variant?
Section titled “variant?”
optionalvariant:"danger"|"default"
Defined in: packages/admin/src/types.ts:139
Button styling variant. "danger" renders a destructive-style button. Defaults to "default".