Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update customize-icons.mdx #138

Merged
merged 1 commit into from
Oct 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ import Example from '../../../examples/font-awesome-icons';

Material React Table uses [Material Icons](https://mui.com/material-ui/material-icons) by default for all of its internal icons.

If you need to, you can customize and replace some or all of the icons with your own custom icons. You can either use other Material Icons, or icons from a completely different library.
If you need to, you can customize and replace some or all of the icons with your own custom icons. You can either use other Material Icons or icons from a completely different library.

### Relevant Props

<RootPropTable onlyProps={new Set(['icons'])} />

### Replace with Custom Icons

To replace a default icon, you specify the icon in the `icons` prop. You should get TS hints for the name of the icons you can replace, but you can also consult [this source file](https://github.com/KevinVandy/material-react-table/blob/main/src/icons.ts) for a list of all the icons you can replace.
To replace a default icon, specify the icon in the `icons` prop. You should get TS hints for the name of the icons you can replace, but you can also consult [this source file](https://github.com/KevinVandy/material-react-table/blob/main/src/icons.ts) for a list of all the icons you can replace.

```tsx
<MaterialTable
Expand All @@ -34,7 +34,7 @@ To replace a default icon, you specify the icon in the `icons` prop. You should
}}
```

> Some Icons have `style` props that get applied to them internally. So in order to preserve the ability of those Icons to be styled with the correct paddings, margins, or rotations, you should pass in `{...props}` to your custom Icon component as a best practice.
> Some icons have `style` props that get applied to them internally. So, in order to preserve the ability of those Icons to be styled with the correct paddings, margins, or rotations, you should pass in `{...props}` to your custom icon component as a best practice.

### Font Awesome Example

Expand Down