-
Notifications
You must be signed in to change notification settings - Fork 593
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
[Docs] Examples #297
Comments
✨ I'm preparing a PR for an advanced example table that is used in something similar to my own component in a real-life project. I'm currently working on it and have rebuilt it using Nuxt Lab UI. The table features:
What do you think about providing this as an example? Everyone should be able to wrap it or turn it into single components. Currently, I've coded 452 lines, and I'm not finished yet! I have a question regarding mocking or using the API service for this example to simulate these operations. What is your opinion?" table.mp4 |
It would be indeed really nice to have a full data-table example like on https://ui.shadcn.com/examples/tasks. I'd keep the example as simple as possible without any API mocking by hard-coding the data though. Feel free to submit a PR :) |
To be honest, the table example with API is missing in the docs, and this is always used with the filter form API and reset pagination, filitering, etc., which are needed in real life. I will make it as simple as possible. |
I would love to have an example for form validation using Nuxt Labs UI form components and a library like VeeValidate. |
#439 is coming soon for this! |
I was wondering if it makes sense to add an example with SortableJS using VueUse? I mean, the code itself would have no interest because it's very easy to implement. However, the presence of such an example in the doc would be a simple way to remind people it exists, and hence they don't need to use another UI library that would implement it from scratch (kind of the same logic the the date picker example, but in simpler). |
Another interesting example could be a file upload mechanism using https://vueuse.org/core/useFileDialog/#usefiledialog |
Have you implemented VeeValidate + Yup with NuxtLabs UI ? It would be very helpful if you could write an example. |
It's already available: https://ui.nuxtlabs.com/forms/form |
Recently VeeValidate official have created an example for vee-validate + yup + nuxtlabs UI Click Here |
Hi, As There are many Form Component which are still on development or at present not available I have created a basic Form which i am sharing feel free to use it in your project or NuxtLabs UI Team can add it on their Example Doc. suggestions and enhancements are welcome.
Note - I have used yup so you need to install yup using |
Wanted to share this implementation of the pagination, to make the prev/next buttons to be If you have an idea how I can implement it so that the page (1, 2, 3, ...) buttons also render as <template>
<div class="container">
<div class="flex justify-center mt-8 md:mt-12">
<UPagination
v-model="page"
:page-count="pageCount"
:total="state.storiesTotal"
:prevButton="prevPageProps"
:nextButton="nextPageProps" />
</div>
</div>
</template>
<script setup lang="ts">
import type { Button } from '@nuxt/ui/dist/runtime/types'
// Amount of articles per page
const pageCount = ref(3)
// Current page count
// Custom composable that sets a query parameter.
const { searchQuery } = useRouteSearchQuery({ name: 'page', defaultValue: '1' })
const page = computed<number>({
get: () => Number(searchQuery.value),
set: value => {
searchQuery.value = String(value)
},
})
// Pagination UI props, used to render the prev/next buttons as `<a>` (due to the `to` prop)
const nextPageProps = computed<Partial<Button> | undefined>(() => {
const canGoNext = page.value * pageCount.value < state.value.storiesTotal
return canGoNext ? { to: { query: { page: page.value + 1 } } } : undefined
})
const prevPageProps = computed<Partial<Button> | undefined>(() => {
const canGoPrev = page.value > 1
return canGoPrev ? { to: { query: { page: page.value - 1 } } } : undefined
})
// Data fetch
// Custom data fetching composable, not important for the example
const { state, fetchStories } = await useStoryList({
key: 'ratgeber-alle-artikel',
init: {
...defaultOptions.value,
page: page.value,
},
})
watch(page, () => {
fetchStories({
...defaultOptions.value,
page: page.value,
})
})
</script> |
I would love to see this example |
Plese make range from - to, input autocomplete with hints. And it will be also good if you make float label in control fields. |
Feel free to comment here if you have some examples you'd like to see on the documentation: https://ui.nuxtlabs.com/getting-started/examples
The text was updated successfully, but these errors were encountered: