-
Notifications
You must be signed in to change notification settings - Fork 696
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
Add drag behaviour to accordion
#3637
Comments
Anyone wondering how to make it work easily with vueuse, use UseSortable. <script setup>
import { useSortable } from "@vueuse/integrations/useSortable";
const accordion = useTemplateRef("accordion");
const items = ref([
{
label: "Icons",
icon: "i-lucide-smile",
content: "You have nothing to do, @nuxt/icon will handle it automatically.",
},
{
label: "Colors",
icon: "i-lucide-swatch-book",
content:
"Choose a primary and a neutral color from your Tailwind CSS theme.",
},
{
label: "Components",
icon: "i-lucide-box",
content:
"You can customize components by using the `class` / `ui` props or in your app.config.ts.",
},
]);
useSortable(accordion, items, {
animation: 150,
});
</script>
<template>
<UPageCard variant="subtle" title="Links">
<UFormField label="Socials">
<UAccordion ref="accordion" :items="items" />
</UFormField>
</UPageCard>
</template>
@benjamincanac maybe nice to add some docs for this that this is even easily possible? |
We can definitely add this in the examples yes: https://ui.nuxt.com/components/accordion#examples |
@stijns96 Do you plan to open a PR for this? |
Sure! |
How to correctly contribute now a days? Is that from the V3 branch? |
Description
I think it would be very cool and helpful if the accordion items could have some drag functionality. I want my users to be able to add links to their account in a accordion form. They should be able to reorder it as well. Not sure if the accordion is the right component to add it or that it could be something on it's own. You might have different thoughts. See #825
Additional context
No response
The text was updated successfully, but these errors were encountered: