Accordion

Installation

npx shadcn@latest add https://ui.timkit.cn/r/accordion.json

Usage

import { Accordion } from "@/components/ui/accordion"

Examples

Accordion · With chevron
Loading preview...
Accordion · With plus-minus
Loading preview...
Accordion · With left chevron
Loading preview...
Accordion · With left plus-minus
Loading preview...
Accordion · With icon and chevron
Loading preview...
Accordion · With icon and plus-minus
Loading preview...
Accordion · With sub-header and chevron
Loading preview...
Accordion · With sub-header and plus-minus
Loading preview...
Accordion · With icon, sub-header, and chevron
Loading preview...
Accordion · With icon, sub-header, and plus-minus
Loading preview...
Accordion · Tabs w/ chevron
Loading preview...
Accordion · Tabs w/ plus-minus
Loading preview...
Accordion · Tabs w/ left chevron
Loading preview...
Accordion · Tabs w/ left plus-minus
Loading preview...
Accordion · Table w/ chevron
Loading preview...
Accordion · Table w/ plus-minus
Loading preview...
Accordion · Table w/ left chevron
Loading preview...
Accordion · Table w/ left plus-minus
Loading preview...
Accordion · Multi-level
Loading preview...
Accordion · Multi-level w/ icon
Loading preview...

Structured API

Component

accordion

Logic

zag / accordion

Runtime Frameworks

ReactVueWeappHTML

Supported Platforms

WebWeChat Mini Program
Configuration
PropTypeDefaultDescription
logic.provider*
enum (zag | native | none)
zagState and interaction provider used by this component.
logic.machine
string
accordionUnderlying state machine identifier when provider is zag.
platforms*
array
Web, WeChat Mini ProgramPlatforms officially supported by this schema.
frameworks*
array
React, Vue, Weapp, HTMLFramework demos/code currently available in registry files.
dependencies
array
@timui/core, @zag-js/reactRuntime package dependencies required by this registry item.
optionalPeerDependencies
array
lucide-reactOptional peer dependencies used by this registry item.
registryDependencies
array
use-machineDependent Timkit registry components/hook entries.
Props
PropTypeDefaultDescription
type
enum (single | multiple)
singleThe selection mode of the accordion.
collapsible
boolean
falseWhether a single accordion item can be collapsed after it has been opened.
value
string
-The controlled value of the accordion items to expand.
disabled
boolean
falseWhether the accordion is disabled.
Events
PropTypeDefaultDescription
onValueChange
event
-Event handler called when the value changes.
Slots
PropTypeDefaultDescription
default
slot
-The accordion items
Parts
PropTypeDefaultDescription
root*
root
-The accordion container
item
part
-An accordion item
trigger
part
-The toggle button for an item
content
part
-The collapsible content section
This API reference is generated from `/packages/core` component schemas to keep React/Vue/Weapp docs consistent.

Extended notes are not available for this component yet.

Accordion

Installation

npx shadcn@latest add https://ui.timkit.cn/r/accordion.json

Usage

import { Accordion } from "@/components/ui/accordion"

Examples

Accordion · With chevron
Loading preview...
Accordion · With plus-minus
Loading preview...
Accordion · With left chevron
Loading preview...
Accordion · With left plus-minus
Loading preview...
Accordion · With icon and chevron
Loading preview...
Accordion · With icon and plus-minus
Loading preview...
Accordion · With sub-header and chevron
Loading preview...
Accordion · With sub-header and plus-minus
Loading preview...
Accordion · With icon, sub-header, and chevron
Loading preview...
Accordion · With icon, sub-header, and plus-minus
Loading preview...
Accordion · Tabs w/ chevron
Loading preview...
Accordion · Tabs w/ plus-minus
Loading preview...
Accordion · Tabs w/ left chevron
Loading preview...
Accordion · Tabs w/ left plus-minus
Loading preview...
Accordion · Table w/ chevron
Loading preview...
Accordion · Table w/ plus-minus
Loading preview...
Accordion · Table w/ left chevron
Loading preview...
Accordion · Table w/ left plus-minus
Loading preview...
Accordion · Multi-level
Loading preview...
Accordion · Multi-level w/ icon
Loading preview...

Structured API

Component

accordion

Logic

zag / accordion

Runtime Frameworks

ReactVueWeappHTML

Supported Platforms

WebWeChat Mini Program
Configuration
PropTypeDefaultDescription
logic.provider*
enum (zag | native | none)
zagState and interaction provider used by this component.
logic.machine
string
accordionUnderlying state machine identifier when provider is zag.
platforms*
array
Web, WeChat Mini ProgramPlatforms officially supported by this schema.
frameworks*
array
React, Vue, Weapp, HTMLFramework demos/code currently available in registry files.
dependencies
array
@timui/core, @zag-js/reactRuntime package dependencies required by this registry item.
optionalPeerDependencies
array
lucide-reactOptional peer dependencies used by this registry item.
registryDependencies
array
use-machineDependent Timkit registry components/hook entries.
Props
PropTypeDefaultDescription
type
enum (single | multiple)
singleThe selection mode of the accordion.
collapsible
boolean
falseWhether a single accordion item can be collapsed after it has been opened.
value
string
-The controlled value of the accordion items to expand.
disabled
boolean
falseWhether the accordion is disabled.
Events
PropTypeDefaultDescription
onValueChange
event
-Event handler called when the value changes.
Slots
PropTypeDefaultDescription
default
slot
-The accordion items
Parts
PropTypeDefaultDescription
root*
root
-The accordion container
item
part
-An accordion item
trigger
part
-The toggle button for an item
content
part
-The collapsible content section
This API reference is generated from `/packages/core` component schemas to keep React/Vue/Weapp docs consistent.

Extended notes are not available for this component yet.