gravity-ui / uikit

Home Page:https://gravity-ui.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Table improvements: add icons for actions in withTableActions HOC

shbov opened this issue · comments

Is it possible to add icon?: Pick<IconProps, 'data' | 'size'> prop in the TableAction type and display them only if all actions are provided with icons? uikit already has an IconProps interface

It would be nice to have action with icon in the Table component for better UX
image

@shbov It's already implemented:

import {Printer} from '@gravity-ui/icons';

<Table getRowActions={() => [{text: 'Print', icon: <Icon data={Printer} size={12} />}]}/>

I've imporved Table example here: gravity-ui/landing#211

@shbov It's already implemented:

import {Printer} from '@gravity-ui/icons';

<Table getRowActions={() => [{text: 'Print', icon: <Icon data={Printer} size={12} />}]}/>

I've imporved Table example here: gravity-ui/landing#211

Thanks! We also need to add prop icons to TableAction as well here