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

sortIcon for <Table/> component #50158

Closed
vitalijalbu opened this issue Jul 30, 2024 · 2 comments
Closed

sortIcon for <Table/> component #50158

vitalijalbu opened this issue Jul 30, 2024 · 2 comments

Comments

@vitalijalbu
Copy link

What problem does this feature solve?

Would be great to have a sort icon for the entire table component, so we won't repeat icon on each column.

What does the proposed API look like?

<Table rowKey="id" sortIcon={{ascending: <IconUp />, descending: <IconDown />}} />

carbon

@afc163
Copy link
Member

afc163 commented Jul 30, 2024

See #42498

@afc163 afc163 closed this as completed Jul 30, 2024
@vitali-bc
Copy link

See #42498

Yes, that's the point.

it's possible to add it to each column but NOT as general props to the table (which is more simplier i think):

I solved it by adding to the map columns:

            {sortedColumn ? (
              sortedColumn.order === "ascend" ? (
                <SortUpIcon />
              ) : (
                <SortDownIcon />
              )
            ) : null}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants