Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- id: highlight_actions
- title: Actions
- ---
- import MaterialTable from 'material-table';
- import { Button } from '@material-ui/core';
- You can add buttons to rows or toolbar by using actions prop. Actions prop takes array of actions.
- ### Usage
- ```jsx
- <MaterialTable
- // other props
- actions={[
- {
- icon: 'save',
- tooltip: 'Save User',
- onClick: (event, rowData) => {
- // Do save operation
- }
- }
- ]}
- />
- ```
- ### Demo 1
- ```jsx live
- // Using import from .mdx file
- /**
- *
- * WON'T LET ME COMPILE THIS BUT I CAN RUN IT IN DEV (USING yarn start)
- *
- */
- // function Demo(props) {
- // return (
- // <Button color="secondary">
- // Button From @material-ui/core
- // </Button>
- // );
- // }
- ```
- ### Demo 2
- ```jsx live
- // Import in jsx live
- import { Button } from '@material-ui/core';
- function Demo(props) {
- return (
- <Button color="secondary">
- Button From @material-ui/core
- </Button>
- );
- }
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement