ui icon indicating copy to clipboard operation
ui copied to clipboard

Use Pagination component instead of buttons for Data Table

Open WarningImHack3r opened this issue 1 year ago • 4 comments

Since the Pagination component is now available, I wanted to know if implementing it into the docs of the Data Table component would be a good idea.

It could look great and make more sense than the two simple buttons. Or maybe add a tab option to the Pagination subsection of the Data Table docs to offer the option to integrate the Pagination component into the Data Table.

I'm not familiar with React but I could try to do it myself if no one else does. This feature request would help unlock https://github.com/huntabyte/shadcn-svelte/issues/641, whether the answer is positive or negative. Thank you!

WarningImHack3r avatar Jan 13 '24 20:01 WarningImHack3r

I guess there is an example about this usecase.

alamenai avatar Jan 13 '24 22:01 alamenai

I guess there is an example about this usecase.

Yes, but it's not the Pagination component, only 2 simple buttons.

WarningImHack3r avatar Jan 13 '24 22:01 WarningImHack3r

Yes, for an example of using pagination ( not pagination component ) in the table, you can check this code snippet which refers to tasks demo..

It does not use the pagination component but you can replace the buttons with the pagination component.

alamenai avatar Jan 13 '24 23:01 alamenai

Yes, for an example of using pagination ( not pagination component ) in the table, you can check this code snippet which refers to tasks demo..

Thanks for that part, didn't know it was a thing!

It does not use the pagination component but you can replace the buttons with the pagination component.

Yep but my problem is not how to do it, it's providing a "default example" that uses another component that's literally made for that purpose and is 1000x better. That's why I think the Pagination component must be showcased within the Data Table, it makes so much sense here and has more features... I was honestly surprised to see those 2 buttons when the Pagination component already exists.

WarningImHack3r avatar Jan 13 '24 23:01 WarningImHack3r

Yes, for an example of using pagination ( not pagination component ) in the table, you can check this code snippet which refers to tasks demo..

This is great! However, the example is missing one of the core parts of pagination, which is updating the query params when moving through pages, so that the user can return to the page they are currently on. One example is https://table.sadmn.com/.

huyouare avatar Feb 19 '24 06:02 huyouare

This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.

shadcn avatar Jun 27 '24 23:06 shadcn