Accordion
A collapsible component for displaying content in a vertical stack.
React (also known as React.js or ReactJS) is a free and open-source front-end JavaScript library for building user interfaces (UIs). It is maintained by Meta (formerly Facebook) and a large community of individual developers and companies.
SolidJS is a modern JavaScript framework designed for building responsive and high-performing user interfaces (UIs). It provides a declarative approach to UI development, similar to frameworks like React, but with a unique reactivity model that distinguishes it.
Vue is an open-source, progressive JavaScript framework for building user interfaces (UIs) and single-page applications. It is designed to be incrementally adoptable, meaning it can be used to enhance an existing HTML page or scale to a full-featured framework for large applications
Svelte is a modern JavaScript framework and compiler that builds web user interfaces by transforming declarative component code into highly optimized, vanilla JavaScript. Unlike traditional frameworks that rely on a virtual DOM, Svelte shifts the work to a compile step, resulting in smaller, faster applications with less overhead
N/A
React (also known as React.js or ReactJS) is a free and open-source front-end JavaScript library for building user interfaces (UIs). It is maintained by Meta (formerly Facebook) and a large community of individual developers and companies.
SolidJS is a modern JavaScript framework designed for building responsive and high-performing user interfaces (UIs). It provides a declarative approach to UI development, similar to frameworks like React, but with a unique reactivity model that distinguishes it.
Vue is an open-source, progressive JavaScript framework for building user interfaces (UIs) and single-page applications. It is designed to be incrementally adoptable, meaning it can be used to enhance an existing HTML page or scale to a full-featured framework for large applications
Svelte is a modern JavaScript framework and compiler that builds web user interfaces by transforming declarative component code into highly optimized, vanilla JavaScript. Unlike traditional frameworks that rely on a virtual DOM, Svelte shifts the work to a compile step, resulting in smaller, faster applications with less overhead
N/A
import { Accordion } from '@fintech-sandpit/ui/react';
return ( <Accordion.Root defaultValue={['a']}> <Accordion.Item value="a"> <Accordion.ItemTrigger> <span className="text-lg"> Slide A </span>
<Accordion.ItemIndicator /> </Accordion.ItemTrigger>
<Accordion.ItemContent> <p> Slide A content </p> </Accordion.ItemContent> </Accordion.Item>
<Accordion.Item value="b"> <Accordion.ItemTrigger> <span className="text-lg"> Slide B </span>
<Accordion.ItemIndicator /> </Accordion.ItemTrigger>
<Accordion.ItemContent> <p> Slide B content </p> </Accordion.ItemContent> </Accordion.Item>
<Accordion.Item value="c" disabled > <Accordion.ItemTrigger> <span className="text-lg"> Slide C </span>
<Accordion.ItemIndicator /> </Accordion.ItemTrigger>
<Accordion.ItemContent> <p> Slide C content </p> </Accordion.ItemContent> </Accordion.Item> </Accordion.Root>);<script setup lang="ts">import { Accordion } from '@fintech-sandpit/ui/vue';</script>
<template> <Accordion.Root :default-value="['a']"> <Accordion.Item value="a"> <Accordion.ItemTrigger> <span class="text-lg"> Slide A </span>
<Accordion.ItemIndicator /> </Accordion.ItemTrigger>
<Accordion.ItemContent> <p> Slide A content </p> </Accordion.ItemContent> </Accordion.Item>
<Accordion.Item value="b"> <Accordion.ItemTrigger> <span class="text-lg"> Slide B </span>
<Accordion.ItemIndicator /> </Accordion.ItemTrigger>
<Accordion.ItemContent> <p> Slide B content </p> </Accordion.ItemContent> </Accordion.Item>
<Accordion.Item value="c" disabled > <Accordion.ItemTrigger> <span class="text-lg"> Slide C </span>
<Accordion.ItemIndicator /> </Accordion.ItemTrigger>
<Accordion.ItemContent> <p> Slide C content </p> </Accordion.ItemContent> </Accordion.Item> </Accordion.Root></template>Accordion Root Props
Section titled “Accordion Root Props”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
defaultValue | string[] | [] | The initial value of the expanded accordion items | |
collapsible | boolean | false | Whether an accordion item can be closed after it has been expanded | |
disabled | boolean | false | Badge style variant | |
multiple | boolean | false | The value of the expanded accordion items |
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
default-value | string[] | [] | The initial value of the expanded accordion items | |
collapsible | boolean | false | Whether an accordion item can be closed after it has been expanded | |
disabled | boolean | false | Badge style variant | |
multiple | boolean | false | The value of the expanded accordion items |
Accordion Item Props
Section titled “Accordion Item Props”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
value | string | Yes | The value of the accordion item | |
disabled | boolean | false | Whether the accordion item is disabled |
Accordion Item Indicator Props
Section titled “Accordion Item Indicator Props”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
icon | IconDefinition | faChevronDown | The icon to display in the accordion item indicator 1 |
- See Icons for the list of available icon definitions.