축소
축소 및 확장할 수 있는 콘텐츠 영역입니다.
사용 시기
- 페이지를 깨끗하게 유지하기 위해 복잡한 영역을 그룹화하거나 숨기는 데 사용할 수 있습니다.
- 아코디언은 특별한 종류의 축소 기능으로, 한 번에 하나의 패널만 확장할 수 있습니다.
축소
한 번에 두 개 이상의 패널을 확장할 수 있습니다.
A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome guest in many households across the world.
A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome guest in many households across the world.
A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome guest in many households across the world.
astro
<Accordion>
<AccordionItem title="This is panel header 1">
A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome guest in many households across the world.
</AccordionItem>
<AccordionItem title="This is panel header 2">
A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome guest in many households across the world.
</AccordionItem>
<AccordionItem title="This is panel header 3">
A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome guest in many households across the world.
</AccordionItem>
</Accordion> 아코디언
아코디언 모드, 한 번에 하나의 패널만 확장할 수 있습니다.
This is panel header 1 content
This is panel header 2 content
This is panel header 3 content
astro
<Accordion type="single">
<AccordionItem title="This is panel header 1" isOpen>
This is panel header 1 content
</AccordionItem>
<AccordionItem title="This is panel header 2">
This is panel header 2 content
</AccordionItem>
<AccordionItem title="This is panel header 3">
This is panel header 3 content
</AccordionItem>
</Accordion> 추가 노드 / 아이콘
`icon` 및 `expandIcon` 속성을 사용하여 아이콘을 사용자 정의할 수 있습니다.
Manage your account settings and preferences.
View and update your payment methods and billing history.
Configure how you receive alerts and updates.
astro
<Accordion>
<AccordionItem title="Account Settings" icon="User">
Manage your account settings and preferences.
</AccordionItem>
<AccordionItem title="Billing Information" icon="CreditCard">
View and update your payment methods and billing history.
</AccordionItem>
<AccordionItem title="Notifications" icon="Bell">
Configure how you receive alerts and updates.
</AccordionItem>
</Accordion> 사용자 정의 패널 헤더
`title` 슬롯을 사용하여 각 패널의 헤더 스타일을 사용자 정의합니다.
This item uses a custom slot for the title to allow complex layouts.
astro
<Accordion>
<AccordionItem>
<div slot="title" class="flex items-center justify-between w-full pr-4 text-left">
<span class="font-semibold text-blue-600 dark:text-blue-400">Custom Styled Title</span>
<span class="text-xs px-2 py-1 bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300 rounded-full">New</span>
</div>
This item uses a custom slot for the title to allow complex layouts.
</AccordionItem>
</Accordion> API
Accordion
| 속성 | 설명 | 타입 | 기본값 |
|---|---|---|---|
| type | 한 번에 확장되는 항목을 "single" 또는 "multiple"로 허용하도록 동작을 설정합니다. | "single" | "multiple" | "multiple" |
| class | 아코디언 컨테이너에 적용할 추가 CSS 클래스입니다. | string | '' |
AccordionItem
| 속성 | 설명 | 타입 | 기본값 |
|---|---|---|---|
| title | 아코디언 항목의 텍스트 제목입니다. | string | '' |
| isOpen | 항목이 기본적으로 열려 있는지 여부입니다. | boolean | false |
| icon | 제목 왼쪽에 표시할 아이콘입니다. | IconName | '' |
| expandIcon | 확장 트리거를 위해 오른쪽에 표시할 아이콘입니다. | IconName | "ChevronDown" |
| class | 항목에 대한 추가 CSS 클래스입니다. | string | '' |