Collapse is used for showing and hiding content.
Class name | Type | |
---|---|---|
collapse | Component | Collapse |
collapse-title | Part | Title part |
collapse-content | Part | Content part |
collapse-arrow | Modifier | Adds arrow icon |
collapse-plus | Modifier | Adds plus/minus icon |
collapse-open | Modifier | Force open |
collapse-close | Modifier | Force close |
Also see accordion examples
<div tabindex="0" class="$$collapse bg-base-100 border border-base-300"> <div class="$$collapse-title font-semibold">How do I create an account?</div> <div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div> </div>
<div tabindex="0" class="$$collapse bg-base-100 border border-base-300">
<div class="$$collapse-title font-semibold">How do I create an account?</div>
<div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div>
</div>
<div tabindex="0" class="$$collapse bg-base-100 border border-base-300"> <div class="$$collapse-title font-semibold">How do I create an account?</div> <div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div> </div>
<div tabindex="0" class="$$collapse bg-base-100 border border-base-300">
<div class="$$collapse-title font-semibold">How do I create an account?</div>
<div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div>
</div>
<div class="$$collapse bg-base-100 border border-base-300"> <input type="checkbox" /> <div class="$$collapse-title font-semibold">How do I create an account?</div> <div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div> </div>
<div class="$$collapse bg-base-100 border border-base-300">
<input type="checkbox" />
<div class="$$collapse-title font-semibold">How do I create an account?</div>
<div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div>
</div>
<div class="$$collapse bg-base-100 border border-base-300"> <input type="checkbox" /> <div class="$$collapse-title font-semibold">How do I create an account?</div> <div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div> </div>
<div class="$$collapse bg-base-100 border border-base-300">
<input type="checkbox" />
<div class="$$collapse-title font-semibold">How do I create an account?</div>
<div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div>
</div>
<details class="$$collapse bg-base-100 border border-base-300"> <summary class="$$collapse-title font-semibold">How do I create an account?</summary> <div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div> </details>
<details class="$$collapse bg-base-100 border border-base-300">
<summary class="$$collapse-title font-semibold">How do I create an account?</summary>
<div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div>
</details>
<details class="$$collapse bg-base-100 border border-base-300"> <summary class="$$collapse-title font-semibold">How do I create an account?</summary> <div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div> </details>
<details class="$$collapse bg-base-100 border border-base-300">
<summary class="$$collapse-title font-semibold">How do I create an account?</summary>
<div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div>
</details>
<details>
tag, we can't have animations because <details>
tag doesn't allow CSS transitions.<div tabindex="0" class="$$collapse border-base-300 bg-base-100 border border-base-300 border"> <div class="$$collapse-title font-semibold">How do I create an account?</div> <div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div> </div>
<div tabindex="0" class="$$collapse border-base-300 bg-base-100 border border-base-300 border">
<div class="$$collapse-title font-semibold">How do I create an account?</div>
<div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div>
</div>
<div tabindex="0" class="$$collapse border-base-300 bg-base-100 border border-base-300 border"> <div class="$$collapse-title font-semibold">How do I create an account?</div> <div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div> </div>
<div tabindex="0" class="$$collapse border-base-300 bg-base-100 border border-base-300 border">
<div class="$$collapse-title font-semibold">How do I create an account?</div>
<div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div>
</div>
<div tabindex="0" class="$$collapse $$collapse-arrow border-base-300 bg-base-100 border border-base-300 border"> <div class="$$collapse-title font-semibold">How do I create an account?</div> <div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div> </div>
<div tabindex="0" class="$$collapse $$collapse-arrow border-base-300 bg-base-100 border border-base-300 border">
<div class="$$collapse-title font-semibold">How do I create an account?</div>
<div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div>
</div>
<div tabindex="0" class="$$collapse $$collapse-arrow border-base-300 bg-base-100 border border-base-300 border"> <div class="$$collapse-title font-semibold">How do I create an account?</div> <div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div> </div>
<div tabindex="0" class="$$collapse $$collapse-arrow border-base-300 bg-base-100 border border-base-300 border">
<div class="$$collapse-title font-semibold">How do I create an account?</div>
<div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div>
</div>
<div tabindex="0" class="$$collapse $$collapse-plus border-base-300 bg-base-100 border border-base-300 border"> <div class="$$collapse-title font-semibold">How do I create an account?</div> <div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div> </div>
<div tabindex="0" class="$$collapse $$collapse-plus border-base-300 bg-base-100 border border-base-300 border">
<div class="$$collapse-title font-semibold">How do I create an account?</div>
<div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div>
</div>
<div tabindex="0" class="$$collapse $$collapse-plus border-base-300 bg-base-100 border border-base-300 border"> <div class="$$collapse-title font-semibold">How do I create an account?</div> <div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div> </div>
<div tabindex="0" class="$$collapse $$collapse-plus border-base-300 bg-base-100 border border-base-300 border">
<div class="$$collapse-title font-semibold">How do I create an account?</div>
<div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div>
</div>
<div tabindex="0" class="$$collapse $$collapse-open border-base-300 bg-base-100 border border-base-300 border"> <div class="$$collapse-title font-semibold">I have collapse-open class</div> <div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div> </div>
<div tabindex="0" class="$$collapse $$collapse-open border-base-300 bg-base-100 border border-base-300 border">
<div class="$$collapse-title font-semibold">I have collapse-open class</div>
<div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div>
</div>
<div tabindex="0" class="$$collapse $$collapse-open border-base-300 bg-base-100 border border-base-300 border"> <div class="$$collapse-title font-semibold">I have collapse-open class</div> <div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div> </div>
<div tabindex="0" class="$$collapse $$collapse-open border-base-300 bg-base-100 border border-base-300 border">
<div class="$$collapse-title font-semibold">I have collapse-open class</div>
<div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div>
</div>
<div tabindex="0" class="$$collapse $$collapse-close border-base-300 bg-base-100 border border-base-300 border"> <div class="$$collapse-title font-semibold">I have collapse-open class</div> <div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div> </div>
<div tabindex="0" class="$$collapse $$collapse-close border-base-300 bg-base-100 border border-base-300 border">
<div class="$$collapse-title font-semibold">I have collapse-open class</div>
<div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div>
</div>
<div tabindex="0" class="$$collapse $$collapse-close border-base-300 bg-base-100 border border-base-300 border"> <div class="$$collapse-title font-semibold">I have collapse-open class</div> <div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div> </div>
<div tabindex="0" class="$$collapse $$collapse-close border-base-300 bg-base-100 border border-base-300 border">
<div class="$$collapse-title font-semibold">I have collapse-open class</div>
<div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div>
</div>
<div tabindex="0" class="bg-primary text-primary-content focus:bg-secondary focus:text-secondary-content collapse"> <div class="$$collapse-title font-semibold">How do I create an account?</div> <div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div> </div>
<div
tabindex="0"
class="bg-primary text-primary-content focus:bg-secondary focus:text-secondary-content collapse">
<div class="$$collapse-title font-semibold">How do I create an account?</div>
<div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div>
</div>
<div tabindex="0" class="bg-primary text-primary-content focus:bg-secondary focus:text-secondary-content collapse"> <div class="$$collapse-title font-semibold">How do I create an account?</div> <div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div> </div>
<div
tabindex="0"
class="bg-primary text-primary-content focus:bg-secondary focus:text-secondary-content collapse">
<div class="$$collapse-title font-semibold">How do I create an account?</div>
<div class="$$collapse-content text-sm">Click the "Sign Up" button in the top right corner and follow the registration process.</div>
</div>
<div class="bg-base-100 border border-base-300 collapse"> <input type="checkbox" class="peer" /> <div class="$$collapse-title bg-primary text-primary-content peer-checked:bg-secondary peer-checked:text-secondary-content"> How do I create an account? </div> <div class="$$collapse-content bg-primary text-primary-content peer-checked:bg-secondary peer-checked:text-secondary-content"> Click the "Sign Up" button in the top right corner and follow the registration process. </div> </div>
<div class="bg-base-100 border border-base-300 collapse">
<input type="checkbox" class="peer" />
<div class="$$collapse-title bg-primary text-primary-content peer-checked:bg-secondary peer-checked:text-secondary-content">
How do I create an account?
</div>
<div
class="$$collapse-content bg-primary text-primary-content peer-checked:bg-secondary peer-checked:text-secondary-content">
Click the "Sign Up" button in the top right corner and follow the registration process.
</div>
</div>
<div class="bg-base-100 border border-base-300 collapse"> <input type="checkbox" class="peer" /> <div class="$$collapse-title bg-primary text-primary-content peer-checked:bg-secondary peer-checked:text-secondary-content"> How do I create an account? </div> <div class="$$collapse-content bg-primary text-primary-content peer-checked:bg-secondary peer-checked:text-secondary-content"> Click the "Sign Up" button in the top right corner and follow the registration process. </div> </div>
<div class="bg-base-100 border border-base-300 collapse">
<input type="checkbox" class="peer" />
<div class="$$collapse-title bg-primary text-primary-content peer-checked:bg-secondary peer-checked:text-secondary-content">
How do I create an account?
</div>
<div
class="$$collapse-content bg-primary text-primary-content peer-checked:bg-secondary peer-checked:text-secondary-content">
Click the "Sign Up" button in the top right corner and follow the registration process.
</div>
</div>