vue3-rich-accordion

Vue 3 rich accordion component
24,034
Install
npm install vue3-rich-accordion
Latest Version:0.0.7
Vue:3
License:MIT
Last Updated:Jul 17, 2022
Links: npm
Maintainer: st1cker0ne

via yarn

yarn add vue3-rich-accordion

or via npm

npm i vue3-rich-accordion
// ./src/main.ts

import { createApp } from "vue";
import App from "./App.vue";
import { useAccordion } from "vue3-rich-accordion";
import "vue3-rich-accordion/accordion-library-styles.css";
//import "vue3-rich-accordion/accordion-library-styles.scss"; if you wanna to use scss

const app = createApp(App);
app.use(useAccordion);

app.mount("#app");

or you can use via importing sfc

// SomeVueComponent.vue
<script setup>
    import { AccordionList, AccordionItem } from "vue3-rich-accordion";
</script>

You can see the full example on demo page Also you can see code example in AccordionSandbox.vue

    interface IAccordionListProps {
    openMultipleItems ? : boolean;      // if true you can open multiple items same time
    state ? : Record<string, boolean>;  // representing list state {"id1": true, "id2": false} - means 1 item is opened and 2 one is closed
    setClosePropertyTime ? : number;    // do not touch if everything is ok. it is used to order closing and animation 
}

interface IAccordionItemProps {
    id?: string;                //Custom id. It is the key in the state object of AccordionList
    defaultOpened?: boolean;    // if provided item would be opened by default. 
    disabled?: boolean          // is item disabled or not 
}

<AccordionItem>
    <template #summary>Item summary</template>
    <template #icon>☝️</template>
    <h3>Main content</h3>
</AccordionItem>
import "vue3-rich-accordion/accordion-library-styles.css";
//import "vue3-rich-accordion/accordion-library-styles.scss"; if you wanna to use scss

You also can clone this files and change for your design

Default icon is described in styles, you can change it via styles customization

Related Packages

vue-badger-accordion

Badger-Accordion Component for Vue

37,790 24
vue-collapsible-component

Vue component to wrap content in Collapsible element with trigger to open and cl...

22,082
@mtcmedia/vue-collapsible

Vue 3 collapsible component

3,498
vue-collapsed

Dynamic CSS height transition from any value to auto and vice versa for Vue 3. A...

642,069 169
vue3-collapse

A Vue 3 custom hook for creating a collapsible element with height transition an...

2,050 4

Version History

Version Released License
0.0.7 MIT
0.0.6 MIT
0.0.5 MIT
0.0.4 MIT
0.0.3