nextui-org / nextui

🚀 Beautiful, fast and modern React UI library.
https://nextui.org
MIT License
22.18k stars 1.56k forks source link

[Feature Request] Vertical table or responsive table design for small screen devices #3809

Open ChaserZ98 opened 2 months ago

ChaserZ98 commented 2 months ago

Is your feature request related to a problem? Please describe.

The current table component does not adapt well on the situation where you have plenty columns of data in a small screen. It is difficult for users to have a full view of one single row of data in a device with small screen. Such bad experience also happens when a column requires much more height than other columns to display. For example, an image column with other short text columns.

Describe the solution you'd like

Add an isVertical attribute to Table props to change table from displaying rows of data to columns of data. And if isHeaderSticky is passed, the header should be sticky to the horizontal scroll instead of vertical scroll.

<Table aria-label="Example empty table" isVertical>
  <TableHeader>
    <TableColumn>Column 1</TableColumn>
    <TableColumn>Column 2</TableColumn>
    <TableColumn>Column 3</TableColumn>
  </TableHeader>
</Table>

An expected behavior would be as the following image shows. 68747470733a2f2f7777772e6e6963686570757273756974732e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031392f30332f636f6d70617269736f6e7461626c652e706e67

Describe alternatives you've considered

Another alternative would be something like table-with-header-cells-in-the-first-column-only. But I doubt if it fits the current design logic of Table component in NextUI.

Screenshots or Videos

No response

linear[bot] commented 2 months ago

ENG-1405 [Feature Request] Vertical table or responsive table design for small screen devices

qwertyroop commented 2 months ago

I will be working on this kindly assign me this.

wingkwong commented 2 months ago

@qwertyroop please discuss your plan with the team in discord first. You may ping me at discord (same id).