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

feat(table): add slot for empty state #260

Merged
merged 6 commits into from
Jun 9, 2023

Conversation

Haythamasalama
Copy link
Contributor

@Haythamasalama Haythamasalama commented Jun 7, 2023

This feature allows for customizable content, including custom text, images, or components, to create a meaningful and visually appealing message when the table is empty.

@vercel
Copy link

vercel bot commented Jun 7, 2023

@Haythamasalama is attempting to deploy a commit to the Nuxt Labs Team on Vercel.

A member of the Team first needs to authorize it.

@nuxt-studio-dev
Copy link

nuxt-studio-dev bot commented Jun 7, 2023

Live Preview ready!

Name Edit Preview Latest Commit
ui Edit on Studio ↗︎ View Live Preview 78b1b96

@nuxt-studio
Copy link

nuxt-studio bot commented Jun 7, 2023

Live Preview ready!

Name Edit Preview Latest Commit
ui Edit on Studio ↗︎ View Live Preview 1184cb1

Copy link
Member

What would be the benefit of using the state when you can customize the icon and label through the :empty-state prop or globally in ui.table.default.emptyState and its styling through :ui prop or globally in ui.table.emptyState?

@Haythamasalama
Copy link
Contributor Author

Haythamasalama commented Jun 8, 2023

What would be the benefit of using the state when you can customize the icon and label through the :empty-state prop or globally in ui.table.default.emptyState and its styling through :ui prop or globally in ui.table.emptyState?

Ok, I know you can customize that label and icon, but in some cases of UI, you need to add a svg image with buttons! or when fetching data from the API when there is no data, I'd like to add a quick action button. which I did for a variety of projects.

For examples:

image

image

Here is an example form table in vuetifyjs.

I think the table component should be as flexible as possible to cover all scenarios in the UI, which is used a lot in every system.

Copy link
Member

@benjamincanac benjamincanac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to name slots like props? :empty-state="..." -> #empty-state

@Haythamasalama
Copy link
Contributor Author

Wouldn't it be better to name slots like props? :empty-state="..." -> #empty-state

@benjamincanac done

@benjamincanac benjamincanac changed the title feat(table): add slot for empty state 🗑️ feat(table): add slot for empty state Jun 9, 2023
@benjamincanac benjamincanac merged commit f7a34c8 into nuxt:dev Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants