kliping.pro
  • Docs
  • Explore
  • Builder
  • Directory
  • Colors
  • Typeset
Saved
Docs
  • Sections13
  • Installation5
  • Dark Mode4
  • Forms3
  • Registry6
  • Utilities2
  • More10
  • Components137
  • Accordion
  • Action Bar
  • AI Chat
  • AI Thread List
  • Alert
  • Alert Dialog
  • Angle Slider
  • Animated Grid Pattern
  • Aspect Ratio
  • Attachment
  • Avatar
  • Avatar Group
  • Badge
  • Badge Overflow
  • Banner
  • Border Beam
  • Breadcrumb
  • Bubble
  • Button
  • Button Group
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Checkbox Group
  • Chip
  • Circular Progress
  • Client Only
  • Collapsible
  • Color Picker
  • Color Swatch
  • Combobox
  • Combobox Advanced
  • Command
  • Compare Slider
  • Composition
  • Context Menu
  • Cropper
  • Data Grid
  • Data Table
  • Data Table Advanced
  • Date Picker
  • Dialog
  • Direction Provider
  • Dot Pattern
  • Drawer
  • Dropdown Menu
  • Editable
  • Empty
  • Field
  • File Upload
  • Form
  • FPS
  • Gauge
  • Hitbox
  • Hover Card
  • Input
  • Input Group
  • Input OTP
  • Item
  • Kanban
  • Kbd
  • Kbd Advanced
  • Key Value
  • Label
  • List
  • Listbox
  • Logos
  • Map
  • Marker
  • Marquee
  • Mask Input
  • Masonry
  • Media Player
  • Mention
  • Menubar
  • Message
  • Message Scroller
  • Native Select
  • Navigation Menu
  • Number Field
  • Pagination
  • Particles
  • Pending
  • Phone Input
  • Pin Input
  • Popover
  • Portal
  • Presence
  • Progress
  • QR Code
  • Questionnaire
  • Radio Group
  • Range Calendar
  • Rating
  • Relative Time Card
  • Resizable
  • Responsive Dialog
  • Scroll Area
  • Scroll Spy
  • Scroller
  • Segmented Input
  • Select
  • Selection Toolbar
  • Separator
  • Sheet
  • Sidebar
  • Skeleton
  • Slider
  • Software Purchase Card
  • Sonner
  • Sortable
  • Speed Dial
  • Spinner
  • Stack
  • Stat
  • Status
  • Stepper
  • Stepper Advanced
  • Swap
  • Switch
  • Table
  • Tabs
  • Tags Input
  • Tags Input Advanced
  • Textarea
  • Time Picker
  • Timeline
  • Toast
  • Toggle
  • Toggle Group
  • Tooltip
  • Tour
  • Typography
  • Visually Hidden
  • Visually Hidden Input
  1. Docs
  2. Components
  3. Accordion

Accordion

PreviousNext

Sekumpulan heading bertumpuk vertikal yang masing-masing membuka satu bagian konten.

View 12 variants
Docs API Reference

Our flagship product combines cutting-edge technology with sleek design. Built with premium materials, it offers unparalleled performance and reliability.

Key features include advanced processing capabilities, and an intuitive user interface designed for both beginners and experts.

Installation ​

pnpm dlx kliping@latest add accordion

Pasang dependensi berikut:

pnpm add reka-ui

Salin dan tempel kode sumber di GitHub ke project Anda.

Sesuaikan path import dengan struktur project Anda.

Usage ​

vue
<script setup lang="ts">
import {
  Accordion,
  AccordionContent,
  AccordionItem,
  AccordionTrigger,
} from '@/components/ui/accordion'
</script>

<template>
  <Accordion type="single" collapsible>
    <AccordionItem value="item-1">
      <AccordionTrigger>Is it accessible?</AccordionTrigger>
      <AccordionContent>
        Yes. It adheres to the WAI-ARIA design pattern.
      </AccordionContent>
    </AccordionItem>
  </Accordion>
</template>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

Requirements ​

Semua dipasang otomatis oleh kliping add; tabel ini untuk Anda yang memasang manual atau memeriksa project.

RequirementValue
ProjectVue 3.5+, Tailwind CSS v4, alias @ — disiapkan kliping init
npm packages@lucide/vue@^1.31.0, @vueuse/core@^14.4.0, reka-ui@^2.10.3
Filescomponents/ui/accordion/accordion.vue
components/ui/accordion/accordion-content.vue
components/ui/accordion/accordion-item.vue
components/ui/accordion/accordion-trigger.vue
components/ui/accordion/index.ts

Anatomy ​

Susunan bagiannya seperti dipakai di contoh-contoh di atas. Impor semua bagian dari satu tempat, lalu susun begini:

vue
<Accordion>
  <AccordionItem>
    <AccordionTrigger />
    <AccordionContent />
  </AccordionItem>
</Accordion>

API Reference ​

Accordion ​

PropTypeDefaultDescription
collapsible?boolean—When type is "single", allows closing content when clicking trigger for an open item. When type is "multiple", this prop has no effect.
disabled?boolean—When true, prevents the user from interacting with the accordion and all its items
dir?Direction—The reading direction of the accordion when applicable. If omitted, assumes LTR (left-to-right) reading mode.
orientation?DataOrientation—The orientation of the accordion.
unmountOnHide?boolean—When true, the element will be unmounted on closed state.
asChild?boolean—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as?AsTag | Component—The element or component this component should render as. Can be overwritten by asChild.
type?SingleOrMultipleType—Determines whether a "single" or "multiple" items can be selected at a time. This prop will overwrite the inferred type from modelValue and defaultValue.
modelValue?string | string[]—The controlled value of the active item(s). Use this when you need to control the state of the items. Can be binded with v-model
defaultValue?string | string[]—The default active value of the item(s). Use when you do not need to control the state of the item(s).
EventPayloadDescription
@update:modelValue[value: string | string[] | undefined]Emitted when the value changes.
SlotProps
#default{ modelValue: AcceptableValue | AcceptableValue[] | undefined; }
Data attributeValue
[data-slot]"accordion"

AccordionContent ​

PropTypeDefaultDescription
forceMount?boolean—Used to force mounting when more control is needed. Useful when controlling animation with Vue animation libraries.
asChild?boolean—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as?AsTag | Component—The element or component this component should render as. Can be overwritten by asChild.
SlotProps
#default—
Data attributeValue
[data-slot]"accordion-content"

AccordionItem ​

PropTypeDefaultDescription
disabled?boolean—Whether or not an accordion item is disabled from user interaction. When true, prevents the user from interacting with the item.
valuestring—A string value for the accordion item. All items within an accordion should use a unique value.
unmountOnHide?boolean—When true, the element will be unmounted on closed state.
asChild?boolean—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as?AsTag | Component—The element or component this component should render as. Can be overwritten by asChild.
SlotProps
#default{ open: boolean; }
Data attributeValue
[data-slot]"accordion-item"

AccordionTrigger ​

PropTypeDefaultDescription
asChild?boolean—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as?AsTag | Component—The element or component this component should render as. Can be overwritten by asChild.
SlotProps
#default—
#icon—
Data attributeValue
[data-slot]"accordion-trigger"
[data-state]set at runtime

Keyboard Interactions ​

Perilaku keyboard-nya datang dari primitif Reka UI Accordion yang dipakai komponen ini, mengikuti pola WAI-ARIA.

KeyDescription
SpaceWhen focus is on an AccordionTrigger of a collapsed section, expands the section.
EnterWhen focus is on an AccordionTrigger of a collapsed section, expands the section.
TabMoves focus to the next focusable element.
Shift + TabMoves focus to the previous focusable element.
ArrowDownMoves focus to the next AccordionTrigger when orientation is vertical.
ArrowUpMoves focus to the previous AccordionTrigger when orientation is vertical.
ArrowRightMoves focus to the next AccordionTrigger when orientation is horizontal.
ArrowLeftMoves focus to the previous AccordionTrigger when orientation is horizontal.
HomeWhen focus is on an AccordionTrigger, moves focus to the start AccordionTrigger.
EndWhen focus is on an AccordionTrigger, moves focus to the last AccordionTrigger.

CSS Variables ​

Token tema yang dibaca komponen ini — ubah nilainya di CSS global (:root dan .dark, lihat Theming) untuk mengubah tampilannya tanpa menyentuh komponennya: --border, --muted-foreground, --radius, --ring.

Credits ​

Berasal dari shadcn-vue (MIT, Copyright (c) 2023 unovue). Rantai lengkapnya di Credits.

PreviousContributingNext Action Bar

On This Page

InstallationUsageRequirementsAnatomyAPI ReferenceAccordionAccordionContentAccordionItemAccordionTriggerKeyboard InteractionsCSS VariablesCredits

© 2026 Kliping. Free components are open source under the MIT License.

LicenseCreditsRoadmap