Examples › Using with Mantine ContextMenu
Mantine doesn’t have a context-menu component, but the DataTable works perfectly with Mantine ContextMenu, built by the same author. Have a look at the examples below to learn how.
ContextMenuProvider
and include the necessary CSS files in the correct order. Please refer to the getting started page of Mantine ContextMenu for more information.Row context-menu
Here’s how you could use the onRowContextMenu
property to create this useful functionality for your data-rich desktop applications:
Name | Street address | City | State |
---|---|---|---|
Feest, Bogan and Herzog | 21716 Ratke Drive | Stromanport | WY |
Cummerata - Kuhlman | 6389 Dicki Stream | South Gate | NH |
Goyette Inc | 8873 Mertz Rapid | Dorthyside | ID |
Runte Inc | 2996 Ronny Mount | McAllen | MA |
Goldner, Rohan and Lehner | 632 Broadway Avenue | North Louie | WY |
Doyle, Hodkiewicz and O'Connell | 576 Joyce Ways | Tyraburgh | KS |
Rau - O'Hara | 7508 Lansdowne Road | Shieldsborough | MI |
Tillman - Jacobi | 57918 Gwendolyn Circles | Sheridanport | MI |
Connelly, Feest and Hodkiewicz | 7057 Stanley Road | Kearaburgh | CA |
Shanahan, Robel and Beier | 378 Berta Crescent | West Gerry | KS |
Kling - McLaughlin | 8346 Kertzmann Square | South Joesph | ID |
Jogi - McLaughlin | 83462 Shazam Street | North Joesph | ID |
Jogi - McLaughlin | 83462 Shazam Street | North Joesph | ID |
Here’s the code for the example above:
'use client';
// 👆 Since 'useContextMenu' is a hook, don't forget to add the 'use client' directive
// at the top of your file if you're using it in a RSC context
import { useMediaQuery } from '@mantine/hooks';
import { showNotification } from '@mantine/notifications';
import { IconEdit, IconEye, IconTrash } from '@tabler/icons-react';
import { DataTable } from 'mantine-datatable';
import { useContextMenu } from 'mantine-contextmenu';
import companies from '~/data/companies.json';
export function RowContextMenuExample() {
const { showContextMenu } = useContextMenu();
const isTouch = useMediaQuery('(pointer: coarse)');
return (
<DataTable
withTableBorder
withColumnBorders
textSelectionDisabled={isTouch} // 👈 disable text selection on touch devices
columns={[{ accessor: 'name' }, { accessor: 'streetAddress' }, { accessor: 'city' }, { accessor: 'state' }]}
records={companies}
onRowContextMenu={({ record, event }) =>
showContextMenu([
{
key: 'view-company-details',
icon: <IconEye size={16} />,
onClick: () =>
showNotification({
message: `Clicked on view context-menu action for ${record.name} company`,
withBorder: true,
}),
},
{
key: 'edit-company-information',
icon: <IconEdit size={16} />,
onClick: () =>
showNotification({
message: `Clicked on edit context-menu action for ${record.name} company`,
withBorder: true,
}),
},
{ key: 'divider' },
{
key: 'delete-company',
icon: <IconTrash size={16} />,
color: 'red',
onClick: () =>
showNotification({
color: 'red',
message: `Clicked on delete context-menu action for ${record.name} company`,
withBorder: true,
}),
},
])(event)
}
/>
);
}
Using with scrollable tables
By default, a Mantine ContextMenu will automatically place an overlay over the entire page and close when the user clicks it, hits the Escape
key, scrolls the or resizes the browser window. However, when using a scrollable DataTable, the user can still scroll the table using the arrow keys, so you might need to close the context-menu when the user scrolls the table by passing the hideContextMenu
function returned by the useContextMenu
hook to the onScroll
property of the DataTable:
First name | Last name | Email |
---|---|---|
Jerald | Howell | Jerald.Howell32@yahoo.com |
Kathleen | Ruecker | Kathleen_Ruecker@hotmail.com |
Erica | Volkman | Erica.Volkman37@gmail.com |
Clifford | Oberbrunner | Clifford.Oberbrunner@hotmail.com |
Alison | Kling | Alison16@gmail.com |
Sue | Zieme | Sue.Zieme29@hotmail.com |
Felicia | Gleason | Felicia30@yahoo.com |
Alfredo | Zemlak | Alfredo22@yahoo.com |
Emily | Bartoletti | Emily.Bartoletti@gmail.com |
Delores | Reynolds | Delores.Reynolds@yahoo.com |
Louis | Schamberger | Louis6@yahoo.com |
Beverly | Heller | Beverly_Heller@gmail.com |
Eugene | Feest | Eugene88@hotmail.com |
Martin | Bahringer | Martin_Bahringer10@gmail.com |
Ellis | Miller | Ellis36@hotmail.com |
Gloria | Cole | Gloria41@gmail.com |
Linda | Witting | Linda_Witting@yahoo.com |
Gregg | Kutch | Gregg_Kutch8@yahoo.com |
Mamie | Raynor | Mamie58@hotmail.com |
Erick | Bruen | Erick_Bruen13@yahoo.com |
Faith | Langworth | Faith_Langworth14@gmail.com |
Alicia | Leannon | Alicia62@yahoo.com |
Boyd | Mohr | Boyd.Mohr@hotmail.com |
Lindsey | Heidenreich | Lindsey31@yahoo.com |
Elsa | Marvin | Elsa.Marvin2@gmail.com |
Debbie | Hagenes | Debbie.Hagenes@hotmail.com |
Lionel | McCullough | Lionel_McCullough@gmail.com |
Kim | Lebsack | Kim.Lebsack66@yahoo.com |
Rolando | Weissnat | Rolando83@hotmail.com |
Jacqueline | Lesch | Jacqueline35@hotmail.com |
Felix | Stokes | Felix77@hotmail.com |
Renee | Tillman | Renee.Tillman@yahoo.com |
Richard | Watsica | Richard_Watsica@yahoo.com |
Nathan | Wolf | Nathan.Wolf@gmail.com |
Jonathan | Keebler-Crona | Jonathan.Keebler-Crona90@gmail.com |
Kathleen | Spinka | Kathleen_Spinka58@hotmail.com |
Bernice | Schinner | Bernice45@hotmail.com |
Adam | Pagac | Adam58@hotmail.com |
Earl | Ryan | Earl.Ryan@gmail.com |
Greg | Bailey | Greg.Bailey@hotmail.com |
Anne | Powlowski | Anne_Powlowski69@gmail.com |
Abraham | Dooley | Abraham_Dooley@gmail.com |
Myron | Lemke | Myron_Lemke@gmail.com |
Dianna | Gislason-Lesch | Dianna88@hotmail.com |
Reginald | Hagenes | Reginald_Hagenes51@gmail.com |
Shelia | Turcotte | Shelia68@yahoo.com |
Carlton | Jenkins | Carlton_Jenkins62@gmail.com |
Lance | Wiegand | Lance_Wiegand@gmail.com |
Ruby | Graham | Ruby20@hotmail.com |
Hattie | Collier | Hattie60@hotmail.com |
Viola | Rath | Viola_Rath6@gmail.com |
Roland | Huel | Roland_Huel@yahoo.com |
Leticia | Wiegand | Leticia65@hotmail.com |
Jacqueline | Kulas | Jacqueline.Kulas@hotmail.com |
Cristina | Jaskolski | Cristina.Jaskolski@hotmail.com |
Felipe | Daugherty | Felipe_Daugherty@hotmail.com |
Timothy | Heaney | Timothy.Heaney@gmail.com |
Alonzo | Kutch | Alonzo12@yahoo.com |
Keith | Kling | Keith25@yahoo.com |
Janice | Goyette | Janice93@gmail.com |
Helen | Kunze-MacGyver | Helen_Kunze-MacGyver@gmail.com |
Barry | Jast | Barry.Jast@yahoo.com |
Ramiro | Cummings | Ramiro.Cummings30@hotmail.com |
Antonio | Little-Bahringer | Antonio.Little-Bahringer@gmail.com |
Samuel | Zemlak | Samuel_Zemlak@gmail.com |
Doris | Emard | Doris_Emard8@gmail.com |
Olivia | Abernathy | Olivia_Abernathy@yahoo.com |
Justin | Kohler | Justin_Kohler42@hotmail.com |
Scott | Oberbrunner | Scott.Oberbrunner57@hotmail.com |
Yolanda | Spinka | Yolanda.Spinka76@hotmail.com |
Brad | Ullrich-Orn | Brad30@yahoo.com |
Gloria | Fisher | Gloria.Fisher22@gmail.com |
Sergio | Crist | Sergio_Crist93@gmail.com |
Theresa | Sporer | Theresa.Sporer85@hotmail.com |
Theodore | Wiegand | Theodore58@yahoo.com |
Rudy | Rowe | Rudy_Rowe25@gmail.com |
Kurt | Raynor | Kurt.Raynor@hotmail.com |
Ruth | Medhurst | Ruth.Medhurst97@yahoo.com |
Tim | Abernathy | Tim0@yahoo.com |
Rebecca | Runolfsdottir | Rebecca.Runolfsdottir41@gmail.com |
Angel | Aufderhar | Angel.Aufderhar19@yahoo.com |
Javier | Bergstrom | Javier12@yahoo.com |
Leigh | Klocko | Leigh.Klocko77@hotmail.com |
Taylor | Rice | Taylor30@yahoo.com |
Cindy | Goldner | Cindy_Goldner47@yahoo.com |
Shannon | Crist | Shannon88@hotmail.com |
Sarah | Maggio | Sarah54@hotmail.com |
Carlton | Langosh-Glover | Carlton.Langosh-Glover@gmail.com |
Felicia | Roob | Felicia_Roob65@yahoo.com |
Simon | Kuhic | Simon30@yahoo.com |
Sharon | Daniel | Sharon.Daniel2@hotmail.com |
Erin | Bayer | Erin4@hotmail.com |
Erika | Powlowski-Corwin | Erika33@gmail.com |
Vicky | Pollich | Vicky_Pollich18@hotmail.com |
Felicia | Ziemann | Felicia.Ziemann56@gmail.com |
Colleen | Crooks | Colleen84@hotmail.com |
Jimmy | Fisher | Jimmy7@yahoo.com |
Lula | Reichert | Lula.Reichert48@gmail.com |
Bethany | Schinner | Bethany.Schinner@yahoo.com |
Allen | Hackett | Allen44@hotmail.com |
Earl | Willms | Earl_Willms81@hotmail.com |
Norma | Dibbert | Norma.Dibbert@yahoo.com |
Ricardo | Franecki | Ricardo_Franecki@hotmail.com |
Patricia | Schulist | Patricia95@gmail.com |
Muriel | Bahringer | Muriel_Bahringer@hotmail.com |
Ricardo | Schowalter | Ricardo_Schowalter9@yahoo.com |
Terry | Beier-O'Reilly | Terry.Beier-OReilly92@hotmail.com |
Sidney | Nader | Sidney47@hotmail.com |
Felicia | Beahan | Felicia.Beahan97@yahoo.com |
Timothy | Wintheiser | Timothy_Wintheiser61@yahoo.com |
Daryl | Kautzer | Daryl_Kautzer56@hotmail.com |
Perry | Tillman | Perry.Tillman57@yahoo.com |
Gregg | Quitzon | Gregg.Quitzon@yahoo.com |
Armando | Lind | Armando_Lind@gmail.com |
Irma | Kilback | Irma27@gmail.com |
Stacy | Davis | Stacy_Davis@hotmail.com |
Austin | O'Conner | Austin33@yahoo.com |
Ira | Kemmer | Ira_Kemmer76@yahoo.com |
Gabriel | Koss | Gabriel_Koss92@gmail.com |
Lisa | Reichert | Lisa.Reichert@hotmail.com |
Darrin | Haag | Darrin17@hotmail.com |
Marianne | Gibson | Marianne69@hotmail.com |
Lois | Rath | Lois_Rath@hotmail.com |
Angela | Mosciski | Angela35@hotmail.com |
Charlie | Rosenbaum | Charlie.Rosenbaum58@gmail.com |
Agnes | Simonis | Agnes.Simonis27@hotmail.com |
Kenneth | Farrell-Altenwerth | Kenneth57@gmail.com |
Michelle | Leffler | Michelle.Leffler@gmail.com |
Alfredo | Altenwerth | Alfredo.Altenwerth@hotmail.com |
Meredith | Volkman | Meredith.Volkman@gmail.com |
Benjamin | Gottlieb | Benjamin23@yahoo.com |
Irene | Brekke | Irene_Brekke@hotmail.com |
Elsie | Mann | Elsie.Mann20@hotmail.com |
Kim | Ebert | Kim.Ebert@hotmail.com |
Emily | Blanda | Emily26@hotmail.com |
Clifton | Feeney | Clifton60@yahoo.com |
David | O'Keefe | David15@hotmail.com |
Marco | Raynor | Marco_Raynor@gmail.com |
Joann | Johnson | Joann_Johnson@yahoo.com |
Elaine | Konopelski | Elaine_Konopelski@hotmail.com |
Winston | Lemke | Winston58@yahoo.com |
Heather | Franey | Heather_Franey@yahoo.com |
Jonathan | Hermiston | Jonathan_Hermiston@yahoo.com |
Jeannie | Doyle | Jeannie.Doyle86@gmail.com |
Angelo | Dietrich | Angelo.Dietrich@hotmail.com |
Tracy | Hintz | Tracy.Hintz@yahoo.com |
Shawna | Jaskolski | Shawna_Jaskolski@hotmail.com |
Candace | Grady | Candace.Grady@yahoo.com |
Priscilla | Gulgowski | Priscilla_Gulgowski@yahoo.com |
Rolando | Heller | Rolando_Heller@hotmail.com |
Sandy | Tillman | Sandy2@hotmail.com |
Josephine | Stoltenberg | Josephine_Stoltenberg65@gmail.com |
Shirley | Heller | Shirley57@gmail.com |
Wilma | Schroeder | Wilma_Schroeder99@hotmail.com |
Natasha | Berge | Natasha81@yahoo.com |
Gertrude | Klocko | Gertrude_Klocko@gmail.com |
Geraldine | Altenwerth | Geraldine51@yahoo.com |
Jim | Nienow | Jim_Nienow7@gmail.com |
Orville | Schmidt | Orville_Schmidt@yahoo.com |
Kathy | Olson | Kathy.Olson29@hotmail.com |
Bert | Dicki | Bert_Dicki45@hotmail.com |
Joy | Schumm | Joy.Schumm@hotmail.com |
Lauren | Ebert | Lauren_Ebert@gmail.com |
Blanche | Zulauf | Blanche24@gmail.com |
Bruce | Veum | Bruce_Veum93@gmail.com |
Katie | Rutherford | Katie80@yahoo.com |
Cary | Kerluke | Cary18@hotmail.com |
Carl | Crona | Carl29@hotmail.com |
Alton | Langosh | Alton_Langosh46@hotmail.com |
Bradford | Trantow | Bradford.Trantow82@gmail.com |
Jessie | Larson | Jessie_Larson@hotmail.com |
Tricia | Stanton | Tricia15@yahoo.com |
Roberto | Ebert | Roberto_Ebert@yahoo.com |
Sharon | Wolff | Sharon.Wolff79@gmail.com |
Gladys | Sanford | Gladys.Sanford19@hotmail.com |
Fannie | McClure | Fannie_McClure@hotmail.com |
Mary | Feil | Mary.Feil@yahoo.com |
Rene | Jast | Rene_Jast@gmail.com |
Mary | Streich | Mary.Streich@gmail.com |
Lindsey | Grant | Lindsey.Grant@hotmail.com |
Alicia | Wehner | Alicia_Wehner@yahoo.com |
Kim | Jacobs | Kim41@yahoo.com |
Kirk | Dooley | Kirk61@yahoo.com |
Muriel | Simonis | Muriel.Simonis32@hotmail.com |
Amber | Dietrich | Amber29@hotmail.com |
Nelson | Mayer | Nelson.Mayer@gmail.com |
Josephine | Stanton | Josephine_Stanton@yahoo.com |
Ronald | Crist | Ronald_Crist99@yahoo.com |
Randolph | Torphy | Randolph99@hotmail.com |
Freddie | Medhurst | Freddie30@hotmail.com |
Josh | Lehner | Josh90@hotmail.com |
Madeline | Kuhn | Madeline43@hotmail.com |
Tammy | Jones | Tammy6@hotmail.com |
Wilfred | Armstrong | Wilfred.Armstrong@yahoo.com |
Cristina | McClure | Cristina9@hotmail.com |
Irma | Olson | Irma25@hotmail.com |
Neal | Zboncak | Neal.Zboncak57@hotmail.com |
Willie | Runolfsdottir | Willie_Runolfsdottir@gmail.com |
Winston | Barton | Winston24@yahoo.com |
Gerardo | Stoltenberg | Gerardo.Stoltenberg@hotmail.com |
Louis | Hand | Louis88@yahoo.com |
Bruce | Quitzon | Bruce20@yahoo.com |
Charlie | Beier | Charlie.Beier37@yahoo.com |
Saul | Lang | Saul4@yahoo.com |
Nathan | Swaniawski | Nathan29@yahoo.com |
Maureen | DuBuque | Maureen39@hotmail.com |
Vera | Buckridge | Vera14@hotmail.com |
Kendra | Gusikowski | Kendra_Gusikowski@yahoo.com |
Alfonso | Larson | Alfonso.Larson@hotmail.com |
Jamie | Berge | Jamie_Berge59@hotmail.com |
Sidney | McKenzie | Sidney_McKenzie49@hotmail.com |
Velma | Terry | Velma55@hotmail.com |
Miriam | Schaden | Miriam.Schaden48@gmail.com |
Geneva | Ferry | Geneva.Ferry@gmail.com |
Julian | Johns | Julian_Johns27@gmail.com |
Herbert | D'Amore | Herbert_DAmore@gmail.com |
Katherine | Schaden | Katherine49@hotmail.com |
Ramon | Heathcote | Ramon.Heathcote@gmail.com |
Clay | Shields | Clay.Shields@yahoo.com |
Grant | Schneider | Grant_Schneider@yahoo.com |
Lorraine | Gibson | Lorraine_Gibson74@hotmail.com |
Byron | Romaguera | Byron_Romaguera34@hotmail.com |
Seth | Boyer | Seth.Boyer@gmail.com |
Fernando | Cremin | Fernando.Cremin@yahoo.com |
Jeanne | Brekke | Jeanne52@hotmail.com |
Delbert | Feil | Delbert_Feil@yahoo.com |
Jean | Renner | Jean.Renner@gmail.com |
Terrence | Gleichner | Terrence.Gleichner@hotmail.com |
Lori | Spinka | Lori_Spinka@hotmail.com |
Norma | Mraz | Norma.Mraz@yahoo.com |
Timmy | Ryan | Timmy.Ryan3@yahoo.com |
Sheila | Hansen | Sheila_Hansen63@hotmail.com |
Stacey | Batz | Stacey_Batz@gmail.com |
Ismael | Kiehn | Ismael_Kiehn5@yahoo.com |
Kirk | Hilpert | Kirk_Hilpert@hotmail.com |
Daniel | Gleichner | Daniel.Gleichner@yahoo.com |
Pedro | Kemmer | Pedro16@yahoo.com |
Norma | Mante | Norma_Mante@hotmail.com |
Grace | Howe | Grace83@hotmail.com |
Timmy | McKenzie | Timmy.McKenzie@gmail.com |
Colleen | Block | Colleen_Block@yahoo.com |
Carroll | Crooks | Carroll.Crooks@yahoo.com |
Tommie | Sporer | Tommie57@gmail.com |
Agnes | Conn | Agnes_Conn@yahoo.com |
Juana | Greenfelder | Juana35@yahoo.com |
Meghan | Reynolds | Meghan26@gmail.com |
Pat | Gislason | Pat.Gislason@yahoo.com |
Tracy | Gulgowski | Tracy81@yahoo.com |
Elsie | Collins | Elsie.Collins@yahoo.com |
Alexandra | Ziemann | Alexandra.Ziemann@hotmail.com |
Bridget | Cummerata | Bridget_Cummerata@gmail.com |
Earl | Buckridge | Earl36@yahoo.com |
Lynette | Deckow | Lynette_Deckow92@hotmail.com |
Mack | Ruecker | Mack_Ruecker2@hotmail.com |
Allan | Mertz | Allan_Mertz@yahoo.com |
Malcolm | Spinka-Stamm | Malcolm_Spinka-Stamm@yahoo.com |
Rogelio | Prohaska | Rogelio93@gmail.com |
Christie | Kuvalis | Christie85@hotmail.com |
Lena | Krajcik | Lena.Krajcik@yahoo.com |
Susan | Romaguera | Susan_Romaguera@gmail.com |
Julie | Towne | Julie_Towne85@gmail.com |
Nicolas | Padberg | Nicolas8@yahoo.com |
Sabrina | Ortiz | Sabrina_Ortiz@yahoo.com |
Harold | Von | Harold_Von@hotmail.com |
Lucy | Johnston-Hane | Lucy_Johnston-Hane@hotmail.com |
Shawna | Homenick | Shawna37@yahoo.com |
Brandi | Ferry | Brandi.Ferry22@gmail.com |
Stacey | Hermann-Volkman | Stacey.Hermann-Volkman69@yahoo.com |
Laura | Fadel | Laura.Fadel78@yahoo.com |
Hilda | Haley | Hilda.Haley@gmail.com |
Adrian | Padberg | Adrian.Padberg@yahoo.com |
Tamara | Lang | Tamara2@yahoo.com |
Blanche | Luettgen | Blanche.Luettgen@gmail.com |
Rose | Zboncak | Rose25@yahoo.com |
Allan | Hilll | Allan.Hilll52@yahoo.com |
Jake | Mayert | Jake.Mayert65@gmail.com |
Latoya | Brakus-Donnelly | Latoya_Brakus-Donnelly@gmail.com |
Thelma | Lindgren | Thelma_Lindgren@hotmail.com |
Steven | Oberbrunner | Steven_Oberbrunner29@yahoo.com |
Domingo | Weimann-Jerde | Domingo_Weimann-Jerde16@hotmail.com |
Chelsea | Wilderman | Chelsea26@hotmail.com |
Tami | Schowalter | Tami13@yahoo.com |
Terence | Grimes | Terence_Grimes@gmail.com |
Estelle | Mueller | Estelle.Mueller@gmail.com |
Dominick | Torp | Dominick.Torp@gmail.com |
Pat | Berge | Pat_Berge97@gmail.com |
Mindy | Fisher | Mindy31@gmail.com |
Fred | Smith | Fred_Smith@gmail.com |
Sonya | Hagenes | Sonya.Hagenes14@hotmail.com |
Lucy | Emard | Lucy_Emard@yahoo.com |
Della | McCullough | Della.McCullough86@hotmail.com |
Barbara | McClure | Barbara.McClure79@hotmail.com |
Vickie | Bruen | Vickie.Bruen@yahoo.com |
Heather | Bergstrom | Heather17@yahoo.com |
Evan | Denesik-Walsh | Evan.Denesik-Walsh@gmail.com |
Gertrude | Ebert | Gertrude67@yahoo.com |
Rudy | Swaniawski | Rudy92@gmail.com |
Myra | Stracke | Myra_Stracke81@hotmail.com |
Benny | Fahey | Benny.Fahey5@yahoo.com |
Bernice | Tillman | Bernice.Tillman15@hotmail.com |
Albert | Prosacco | Albert_Prosacco76@hotmail.com |
Mona | Larson | Mona.Larson@hotmail.com |
Melba | Morissette | Melba.Morissette@hotmail.com |
Shawn | Dare | Shawn70@gmail.com |
Julio | Nitzsche | Julio.Nitzsche2@yahoo.com |
Dianne | Hane | Dianne_Hane@gmail.com |
Tyrone | Goldner | Tyrone_Goldner42@yahoo.com |
Wendy | Hilpert | Wendy_Hilpert@yahoo.com |
Roxanne | Crona | Roxanne_Crona@gmail.com |
Jackie | Johnson | Jackie_Johnson74@hotmail.com |
Joann | Senger | Joann15@hotmail.com |
Felix | Hackett | Felix.Hackett82@yahoo.com |
Byron | Champlin | Byron47@yahoo.com |
Leo | Beahan | Leo_Beahan@gmail.com |
Gerardo | Gulgowski | Gerardo_Gulgowski48@hotmail.com |
Sandra | McKenzie | Sandra.McKenzie73@yahoo.com |
Cassandra | Schneider | Cassandra_Schneider51@hotmail.com |
Willis | Rosenbaum | Willis66@yahoo.com |
Ignacio | Fritsch | Ignacio4@hotmail.com |
Constance | Gleichner | Constance.Gleichner@hotmail.com |
Carl | Kautzer | Carl_Kautzer@hotmail.com |
Melvin | Torphy | Melvin_Torphy@yahoo.com |
Patricia | Veum | Patricia58@hotmail.com |
Evelyn | Koss | Evelyn_Koss32@yahoo.com |
Juana | D'Amore | Juana_DAmore27@hotmail.com |
Sandy | Schneider | Sandy4@hotmail.com |
Ignacio | Aufderhar | Ignacio.Aufderhar33@hotmail.com |
Pat | Stroman-Spencer | Pat_Stroman-Spencer23@yahoo.com |
Tommie | Ondricka | Tommie_Ondricka96@gmail.com |
Flora | Littel | Flora60@hotmail.com |
Orlando | Borer | Orlando.Borer@hotmail.com |
Ruben | Erdman | Ruben_Erdman46@gmail.com |
Eduardo | Thiel | Eduardo.Thiel@hotmail.com |
Dianna | Treutel | Dianna.Treutel@hotmail.com |
Willard | Blick | Willard.Blick80@gmail.com |
Dolores | Smith | Dolores.Smith83@gmail.com |
Jimmy | Balistreri | Jimmy.Balistreri12@yahoo.com |
Jonathon | Fisher | Jonathon.Fisher@gmail.com |
Wayne | Gutkowski | Wayne25@yahoo.com |
Angel | Koss | Angel.Koss@yahoo.com |
Rufus | Cremin | Rufus14@hotmail.com |
Anna | Bayer | Anna_Bayer@gmail.com |
Anne | King | Anne65@yahoo.com |
Hannah | Krajcik-Veum | Hannah.Krajcik-Veum@hotmail.com |
Alexis | Davis | Alexis_Davis42@hotmail.com |
Terence | Daniel | Terence.Daniel@gmail.com |
John | Donnelly | John.Donnelly21@gmail.com |
Leo | Beier | Leo_Beier66@gmail.com |
Miranda | Quigley | Miranda.Quigley3@gmail.com |
Alex | Hills | Alex.Hills@hotmail.com |
Janis | Rogahn | Janis32@hotmail.com |
Laurie | Harvey | Laurie_Harvey@hotmail.com |
Eileen | Boyle | Eileen_Boyle@gmail.com |
Claude | Emard | Claude_Emard95@yahoo.com |
Frank | Harris | Frank10@hotmail.com |
Sheri | Boyle | Sheri_Boyle@yahoo.com |
Irvin | Frami | Irvin.Frami83@hotmail.com |
Shelley | Blick | Shelley.Blick25@hotmail.com |
Sonya | Torp | Sonya.Torp45@gmail.com |
Marjorie | Sauer | Marjorie.Sauer@yahoo.com |
Claude | Kuvalis | Claude_Kuvalis88@hotmail.com |
Jodi | Farrell | Jodi19@gmail.com |
Erik | Hansen | Erik.Hansen@hotmail.com |
Gustavo | Rohan | Gustavo_Rohan83@hotmail.com |
Cedric | Hagenes | Cedric78@hotmail.com |
Marco | MacGyver | Marco.MacGyver62@gmail.com |
Connie | Zemlak | Connie_Zemlak@gmail.com |
Georgia | Dare | Georgia57@hotmail.com |
Rochelle | Bahringer | Rochelle81@yahoo.com |
Sonya | Bergnaum | Sonya_Bergnaum@yahoo.com |
Gary | Rosenbaum | Gary66@yahoo.com |
Brendan | Williamson-D'Amore | Brendan34@yahoo.com |
Albert | Jacobi | Albert8@hotmail.com |
Elsie | Mohr | Elsie_Mohr37@gmail.com |
June | Spinka | June_Spinka67@yahoo.com |
Julia | Doyle | Julia6@yahoo.com |
Jacquelyn | DuBuque | Jacquelyn32@yahoo.com |
Bernice | Upton | Bernice90@hotmail.com |
Joey | Farrell | Joey_Farrell99@yahoo.com |
Vivian | Hackett | Vivian.Hackett46@gmail.com |
Angie | Abbott | Angie57@hotmail.com |
Lois | Gorczany | Lois.Gorczany@yahoo.com |
Brent | Lockman | Brent_Lockman@yahoo.com |
Max | Roberts | Max.Roberts@yahoo.com |
Betsy | McClure-Wilderman | Betsy_McClure-Wilderman@gmail.com |
Latoya | Hyatt | Latoya_Hyatt81@yahoo.com |
Ted | Considine-McCullough | Ted26@hotmail.com |
Wilma | Simonis | Wilma17@yahoo.com |
Keith | Murphy | Keith.Murphy@yahoo.com |
April | Baumbach | April58@gmail.com |
Juan | Harris | Juan7@yahoo.com |
Douglas | Streich | Douglas.Streich@gmail.com |
Lyle | Kub | Lyle_Kub@hotmail.com |
Sabrina | Volkman | Sabrina79@gmail.com |
Krystal | Vandervort | Krystal_Vandervort@gmail.com |
Melody | Flatley | Melody.Flatley@yahoo.com |
Rochelle | Williamson | Rochelle21@gmail.com |
Rhonda | Bradtke | Rhonda.Bradtke@gmail.com |
Vicki | Renner | Vicki93@yahoo.com |
Tara | Roberts | Tara.Roberts@hotmail.com |
Joy | Koelpin | Joy.Koelpin@yahoo.com |
Rodney | Kiehn | Rodney.Kiehn41@hotmail.com |
Stella | Daniel | Stella_Daniel29@yahoo.com |
David | Johnston | David52@yahoo.com |
Bobby | Trantow | Bobby_Trantow61@hotmail.com |
Todd | Stiedemann | Todd_Stiedemann39@yahoo.com |
Maxine | Crona | Maxine.Crona19@hotmail.com |
Arturo | Murray | Arturo.Murray17@yahoo.com |
Marguerite | Greenfelder | Marguerite_Greenfelder21@yahoo.com |
Krista | Schroeder | Krista61@gmail.com |
Nettie | Bruen | Nettie_Bruen@gmail.com |
Diane | Christiansen | Diane.Christiansen95@yahoo.com |
Dennis | Beahan | Dennis_Beahan65@yahoo.com |
Jerome | Heaney | Jerome96@gmail.com |
Colin | Leuschke | Colin3@gmail.com |
Preston | Keeling | Preston_Keeling5@hotmail.com |
Gordon | Fay | Gordon20@hotmail.com |
Janet | Bahringer | Janet.Bahringer@hotmail.com |
Marta | Torp | Marta6@hotmail.com |
Jana | Jenkins | Jana_Jenkins36@hotmail.com |
Andy | McClure | Andy29@yahoo.com |
Harry | Paucek | Harry.Paucek65@yahoo.com |
Susan | Beer | Susan_Beer@hotmail.com |
Glen | Reichert | Glen8@gmail.com |
Norman | Witting-Wiza | Norman27@gmail.com |
Leonard | Ankunding | Leonard.Ankunding@hotmail.com |
Charles | Gutmann | Charles68@yahoo.com |
Amelia | Bernhard-Lang | Amelia_Bernhard-Lang@gmail.com |
Armando | Okuneva | Armando56@gmail.com |
Sonja | Murray | Sonja2@hotmail.com |
Krystal | Schiller | Krystal42@gmail.com |
Lucas | Kutch | Lucas95@yahoo.com |
Roderick | Gulgowski | Roderick_Gulgowski11@hotmail.com |
Eileen | Kshlerin | Eileen92@hotmail.com |
Teri | Johnson | Teri_Johnson77@yahoo.com |
Jeannie | Zemlak-Becker | Jeannie_Zemlak-Becker36@yahoo.com |
Elsa | Jacobi | Elsa84@yahoo.com |
Cecilia | Anderson | Cecilia.Anderson92@yahoo.com |
Minnie | Schmidt | Minnie23@yahoo.com |
Winston | Hoeger | Winston.Hoeger58@yahoo.com |
Elaine | Herman | Elaine12@yahoo.com |
Lewis | Howe | Lewis84@hotmail.com |
Alma | Lind | Alma.Lind@hotmail.com |
Johnny | Hintz | Johnny.Hintz64@yahoo.com |
Matthew | Daniel | Matthew.Daniel89@hotmail.com |
Saul | Bosco | Saul.Bosco@hotmail.com |
Carroll | Heaney | Carroll.Heaney21@hotmail.com |
Adam | Krajcik | Adam93@yahoo.com |
Louis | Steuber | Louis.Steuber32@hotmail.com |
Lucy | Turner | Lucy89@gmail.com |
Gerald | Lynch | Gerald_Lynch@gmail.com |
Darnell | Weber | Darnell10@yahoo.com |
Gilberto | Keebler | Gilberto_Keebler96@hotmail.com |
Clay | Heidenreich | Clay_Heidenreich@yahoo.com |
Claudia | Windler | Claudia.Windler@hotmail.com |
Edward | Cummings | Edward.Cummings68@hotmail.com |
Sheila | Walter-Douglas | Sheila51@hotmail.com |
Arthur | Roberts | Arthur_Roberts@hotmail.com |
Lila | Thompson | Lila.Thompson@hotmail.com |
Randy | Mann | Randy.Mann63@yahoo.com |
Jessica | Rippin | Jessica.Rippin37@hotmail.com |
Jonathon | Rath | Jonathon17@gmail.com |
Thomas | Hodkiewicz | Thomas.Hodkiewicz@hotmail.com |
Geraldine | Nader-Walter | Geraldine_Nader-Walter33@gmail.com |
Gloria | Kohler | Gloria25@gmail.com |
Adrian | Schiller | Adrian_Schiller@yahoo.com |
Inez | Moore | Inez_Moore@yahoo.com |
Donald | Oberbrunner | Donald_Oberbrunner28@yahoo.com |
Mike | Lakin | Mike23@gmail.com |
Elaine | Daugherty | Elaine_Daugherty35@yahoo.com |
Gregg | Miller | Gregg1@gmail.com |
Ethel | Sanford | Ethel_Sanford@gmail.com |
Alyssa | Kirlin-Rippin | Alyssa_Kirlin-Rippin@yahoo.com |
Edith | McKenzie | Edith74@gmail.com |
Toby | Larkin | Toby_Larkin@yahoo.com |
Joy | Larson | Joy95@hotmail.com |
Dan | Wiza | Dan.Wiza1@hotmail.com |
Leland | Kilback | Leland.Kilback36@yahoo.com |
Santiago | Parker | Santiago_Parker5@hotmail.com |
Vicki | Bednar | Vicki_Bednar@gmail.com |
Gilbert | Predovic | Gilbert.Predovic41@hotmail.com |
Matt | Hackett | Matt29@yahoo.com |
Tina | Steuber | Tina_Steuber19@yahoo.com |
Wilma | Hilll | Wilma.Hilll74@hotmail.com |
Benjamin | Yost-Johns | Benjamin73@hotmail.com |
Lisa | Yundt | Lisa_Yundt@hotmail.com |
David | Torp-Stehr | David25@gmail.com |
Lorene | Wiegand | Lorene.Wiegand@gmail.com |
Essie | Mills | Essie98@yahoo.com |
Kristopher | Kutch-Moen | Kristopher_Kutch-Moen@gmail.com |
Mona | Lowe | Mona_Lowe4@gmail.com |
Winston | Considine | Winston.Considine@yahoo.com |
Santos | Volkman | Santos_Volkman@hotmail.com |
Camille | Wisoky | Camille37@gmail.com |
Desiree | King | Desiree_King@hotmail.com |
Lorena | Heaney | Lorena.Heaney44@yahoo.com |
Carol | Littel | Carol.Littel@gmail.com |
Diane | Welch | Diane_Welch69@yahoo.com |
Alvin | Kunde | Alvin55@hotmail.com |
Minnie | Morissette | Minnie52@gmail.com |
Here’s the code for the example above:
const { showContextMenu, hideContextMenu } = useContextMenu();
const isTouch = useMediaQuery('(pointer: coarse)');
return (
<DataTable
height={300}
withTableBorder
withColumnBorders
textSelectionDisabled={isTouch} // 👈 disable text selection on touch devices
columns={[{ accessor: 'firstName' }, { accessor: 'lastName' }, { accessor: 'email' }]}
records={employees}
onRowContextMenu={({ record, event }) =>
showContextMenu([
// context menu items...
])(event)
}
// 👇 make sure the context-menu is closed when the user scrolls the table
onScroll={hideContextMenu}
/>
);
Cell context-menu
You can also use the onCellContextMenu
property to create a context-menu for individual cells. In the example below, we’re showing a context-menu for the name
column:
Name | Street address | City | State |
---|---|---|---|
Feest, Bogan and Herzog | 21716 Ratke Drive | Stromanport | WY |
Cummerata - Kuhlman | 6389 Dicki Stream | South Gate | NH |
Goyette Inc | 8873 Mertz Rapid | Dorthyside | ID |
Runte Inc | 2996 Ronny Mount | McAllen | MA |
Goldner, Rohan and Lehner | 632 Broadway Avenue | North Louie | WY |
Doyle, Hodkiewicz and O'Connell | 576 Joyce Ways | Tyraburgh | KS |
Rau - O'Hara | 7508 Lansdowne Road | Shieldsborough | MI |
Tillman - Jacobi | 57918 Gwendolyn Circles | Sheridanport | MI |
Connelly, Feest and Hodkiewicz | 7057 Stanley Road | Kearaburgh | CA |
Shanahan, Robel and Beier | 378 Berta Crescent | West Gerry | KS |
Kling - McLaughlin | 8346 Kertzmann Square | South Joesph | ID |
Jogi - McLaughlin | 83462 Shazam Street | North Joesph | ID |
Jogi - McLaughlin | 83462 Shazam Street | North Joesph | ID |
Here’s the code for the example above:
const { showContextMenu } = useContextMenu();
const isTouch = useMediaQuery('(pointer: coarse)');
return (
<DataTable
withTableBorder
withColumnBorders
textSelectionDisabled={isTouch} // 👈 disable text selection on touch devices
columns={[{ accessor: 'name' }, { accessor: 'streetAddress' }, { accessor: 'city' }, { accessor: 'state' }]}
records={companies}
onCellContextMenu={({ record, column, event }) => {
if (column.accessor === 'name') {
return showContextMenu([
// context menu items...
])(event);
}
}}
/>
);
Mixing row and cell context-menus
You can also mix row and cell context-menus. In the example below, we’re showing a context-menu for the name
column and a different one for the row:
Name | Street address | City | State |
---|---|---|---|
Feest, Bogan and Herzog | 21716 Ratke Drive | Stromanport | WY |
Cummerata - Kuhlman | 6389 Dicki Stream | South Gate | NH |
Goyette Inc | 8873 Mertz Rapid | Dorthyside | ID |
Runte Inc | 2996 Ronny Mount | McAllen | MA |
Goldner, Rohan and Lehner | 632 Broadway Avenue | North Louie | WY |
Doyle, Hodkiewicz and O'Connell | 576 Joyce Ways | Tyraburgh | KS |
Rau - O'Hara | 7508 Lansdowne Road | Shieldsborough | MI |
Tillman - Jacobi | 57918 Gwendolyn Circles | Sheridanport | MI |
Connelly, Feest and Hodkiewicz | 7057 Stanley Road | Kearaburgh | CA |
Shanahan, Robel and Beier | 378 Berta Crescent | West Gerry | KS |
Kling - McLaughlin | 8346 Kertzmann Square | South Joesph | ID |
Jogi - McLaughlin | 83462 Shazam Street | North Joesph | ID |
Jogi - McLaughlin | 83462 Shazam Street | North Joesph | ID |
Here’s the code for the example above:
const { showContextMenu } = useContextMenu();
const isTouch = useMediaQuery('(pointer: coarse)');
return (
<DataTable
withTableBorder
withColumnBorders
textSelectionDisabled={isTouch} // 👈 disable text selection on touch devices
columns={[{ accessor: 'name' }, { accessor: 'streetAddress' }, { accessor: 'city' }, { accessor: 'state' }]}
records={companies}
onRowContextMenu={({ record, event }) =>
showContextMenu([
// row context menu items...
])(event)
}
onCellContextMenu={({ record, column, event }) => {
if (column.accessor === 'name') {
return showContextMenu([
// 'name' cell context menu items...
])(event);
}
}}
/>
);
Showing a context-menu on left-click
Usually, context-menus are shown when the user right-clicks on a user interface element. However, you can also show a context-menu when the user left-clicks on a row or cell by using the onRowClick
and onCellClick
properties instead of onRowContextMenu
and onCellContextMenu
. Here’s an example:
Name | Street address | City | State |
---|---|---|---|
Feest, Bogan and Herzog | 21716 Ratke Drive | Stromanport | WY |
Cummerata - Kuhlman | 6389 Dicki Stream | South Gate | NH |
Goyette Inc | 8873 Mertz Rapid | Dorthyside | ID |
Runte Inc | 2996 Ronny Mount | McAllen | MA |
Goldner, Rohan and Lehner | 632 Broadway Avenue | North Louie | WY |
Doyle, Hodkiewicz and O'Connell | 576 Joyce Ways | Tyraburgh | KS |
Rau - O'Hara | 7508 Lansdowne Road | Shieldsborough | MI |
Tillman - Jacobi | 57918 Gwendolyn Circles | Sheridanport | MI |
Connelly, Feest and Hodkiewicz | 7057 Stanley Road | Kearaburgh | CA |
Shanahan, Robel and Beier | 378 Berta Crescent | West Gerry | KS |
Kling - McLaughlin | 8346 Kertzmann Square | South Joesph | ID |
Jogi - McLaughlin | 83462 Shazam Street | North Joesph | ID |
Jogi - McLaughlin | 83462 Shazam Street | North Joesph | ID |
Here’s the code for the example above:
const { showContextMenu } = useContextMenu();
const isTouch = useMediaQuery('(pointer: coarse)');
return (
<DataTable
withTableBorder
withColumnBorders
textSelectionDisabled={isTouch} // 👈 disable text selection on touch devices
columns={[{ accessor: 'name' }, { accessor: 'streetAddress' }, { accessor: 'city' }, { accessor: 'state' }]}
records={companies}
// 👇 use `onRowClick` instead of `onRowContextMenu` to
// show context-menu when the user clicks on a row
onRowClick={({ record, event }) =>
showContextMenu([
// context menu items...
])(event)
}
/>
);
Using context-menus inside modals
You can use context-menus inside modals. In the example below, we’re showing a context-menu when the user right-clicks on a table row rendered inside a modal:
Here’s the code for the example above:
const { showContextMenu } = useContextMenu();
const isTouch = useMediaQuery('(pointer: coarse)');
return (
<Button
leftSection={<IconAppWindow size={16} />}
onClick={() =>
modals.open({
centered: true,
title: 'Right-click on a row',
children: (
<DataTable
borderRadius="sm"
height={260}
withTableBorder
withColumnBorders
textSelectionDisabled={isTouch} // 👈 disable text selection on touch devices
columns={[{ accessor: 'name' }, { accessor: 'city' }, { accessor: 'state', textAlign: 'right' }]}
records={companies}
onRowContextMenu={({ record, event }) =>
showContextMenu([
// context menu items...
])(event)
}
/>
),
})
}
>
Open modal
</Button>
);
Head over to the next example to discover more features of Mantine DataTable.