-
Notifications
You must be signed in to change notification settings - Fork 794
feat(FileUpload): new component #4102
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
base: v3
Are you sure you want to change the base?
Conversation
commit: |
Would love to hear your feedback on this when you have a moment, @rdjanuar @benjamincanac, happy to iterate based on your suggestions! |
Thank you for continuing this development @vachmara, actually i'm already done working on this feature but missing only style of component and forget to push it, you can take a look my implementation #2814. maybe on this week i can finish it @benjamincanac |
@vachmara Thank you for this! And also for mentioning it on #1945 which I follow :) @rdjanuar good to hear that your implementation of this feature is near completion!
|
Hey @rdjanuar, I noticed you've already done an excellent job on the logic. I honestly thought the feature was abandoned, and I shouldβve checked in earlier, sorry about that. Iβd be more than happy to help polish and push this component forward with you! @kaspernowak, thanks for pointing out the main functionalities I implemented; spot on! Iβd also like to mention that the file type validation, which you handled nicely, was something I intentionally left out to maintain compatibility with I think both of our implementations bring valuable logic, and it'd be great to merge the best of both. Thereβs still a bit of work to be done, proper testing (for Vue & Nuxt), improving some functionality (UI/UX, core logic like disabled etc..), and writing the proper documentation. Donβt hesitate to share how you'd like to collaborate or areas you'd prefer me to focus on. Looking forward to working together! |
Hi @vachmara , I think Iβll keep my file validation as the default since it already covers all aspects of file upload. Later, I might create a function to allow overriding it based on a given schema. For now, Iβll focus on finishing my work first, and then we can collaborate on it. |
You're not making it easy guys haha Can't we just keep one open and work together on it? I'd go for this one because it's most recent and follows the latest Nuxt UI components architecture pattern. You will both get the contribution anyway. |
sounds good @benjamincanac |
Iβve added tests and a minimal doc to get everyone started. If anythingβs unclear or youβd like to see extra examples or features, just let me know, happy to iterate! |
Hey @benjamincanac, |
β¦nto feat-file-upload
Hi @vachmara, Thanks so much for all the work on the FileUpload component so far, itβs looking fantastic! Iβm really excited to get this merged and start using it. Are there any blockers or bugs I can help with? |
Hey @caiotarifa, Thanks for your message! Everythingβs working well on my end. That said, feel free to try it out in the playground and share any feedback, especially on the design side. Iβm sure thereβs still room for improvement! Also, we should discuss the documentation to make sure itβs clear and complete before merging. |
@vachmara I've looked quickly and it seems pretty good (will review more deeply in the afternoon). Is it possible with this version to make it look like a Button like: |
@benjamincanac Yes, itβs possible to achieve this, but the current approach feels a bit like a workaround due to its complexity: <UChip inset size="3xl" :show="!!avatar?.length">
<template #content>
<UButton
variant="solid"
color="neutral"
icon="i-lucide-x"
size="xs"
class="rounded-full"
@click="avatar = []"
/>
</template>
<UFileUpload
v-model="avatar"
layout="grid"
:ui="{
base: 'rounded-full size-26 p-0',
filesActions: 'hidden',
files: 'overflow-hidden rounded-full size-26',
fileContent: 'rounded-full size-26',
fileImage: 'rounded-full size-26 object-cover'
}"
>
<template #empty>
<div class="relative rounded-full size-24 flex items-center justify-center">
<UIcon name="i-lucide-circle-user-round" size="24" />
</div>
</template>
</UFileUpload>
</UChip> We could consider integrating this directly into the component, but it might introduce extra complexity. |
Regarding the documentation, I havenβt updated it to reflect the new architecture yet. So yes, it would definitely be helpful to include a few concrete examples! |
@vachmara I believe thatβs exactly the goal: add some examples to the docs to highlights the componentβs flexibility (like Origin UI does). https://originui.com/file-upload @benjamincanac, which examples do you think we could add to ensure the component is minimally ready to be merged? |
I'll work on this PR to improve the component a bit and let you know π |
π Linked issue
Resolves #1945
β Type of change
π Description
This PR introduces the
FileUpload
component, a long-requested feature by the Nuxt UI community (see #1945).The
FileUpload
component provides a customizable and accessible file input that supports:π Checklist