Theme

Examples › Row actions cell

If a simple row click or cell click handler is not enough and context menus are not your thing, implementing a row actions cell should’t be difficult. Here’s how you could do it, unsing the column render function:
Sipes IncTwin FallsMT
Runolfsdottir - CummerataMissouri CityKY
Johnston LLCHartfordKY
Crist and SonsAttleboroWV
Schmidt and SonsColliervilleAL
No records
return (
<DataTable
withBorder
shadow="xs"
columns={[
{ accessor: 'name' },
{ accessor: 'city' },
{ accessor: 'state' },
{
accessor: 'actions',
title: <Text mr="xs">Row actions</Text>,
textAlignment: 'right',
render: (company) => (
<Group spacing={4} position="right" noWrap>
<ActionIcon color="green" onClick={() => showInfo(company)}>
<IconEye size={16} />
</ActionIcon>
<ActionIcon color="blue" onClick={() => editInfo(company)}>
<IconEdit size={16} />
</ActionIcon>
<ActionIcon color="red" onClick={() => deleteCompany(company)}>
<IconTrash size={16} />
</ActionIcon>
</Group>
),
},
]}
records={records}
/>
);

Mantine DataTable is trusted by

MIT LicenseSponsor the author
Built by Ionut-Cristian Florescu and these awesome people.
Please sponsor the project if you find it useful.
GitHub StarsNPM Downloads