Accordion is used for showing and hiding content but only one item can stay open at a time.
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 |
Accordion uses the same style as the collapse component but it works with radio inputs. You can control which item to be open by checking/unchecking the hidden radio input.
All radio inputs with the same name work together and only one of them can be open at a time. If you have more than one set of accordion items on a page, use different names for the radio inputs on each set.
<div class="$$collapse bg-base-100 border border-base-300"> <input type="radio" name="my-accordion-1" checked="checked" /> <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="radio" name="my-accordion-1" /> <div class="$$collapse-title font-semibold">I forgot my password. What should I do?</div> <div class="$$collapse-content text-sm">Click on "Forgot Password" on the login page and follow the instructions sent to your email.</div> </div> <div class="$$collapse bg-base-100 border border-base-300"> <input type="radio" name="my-accordion-1" /> <div class="$$collapse-title font-semibold">How do I update my profile information?</div> <div class="$$collapse-content text-sm">Go to "My Account" settings and select "Edit Profile" to make changes.</div> </div>
<div class="$$collapse bg-base-100 border border-base-300">
<input type="radio" name="my-accordion-1" checked="checked" />
<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="radio" name="my-accordion-1" />
<div class="$$collapse-title font-semibold">I forgot my password. What should I do?</div>
<div class="$$collapse-content text-sm">Click on "Forgot Password" on the login page and follow the instructions sent to your email.</div>
</div>
<div class="$$collapse bg-base-100 border border-base-300">
<input type="radio" name="my-accordion-1" />
<div class="$$collapse-title font-semibold">How do I update my profile information?</div>
<div class="$$collapse-content text-sm">Go to "My Account" settings and select "Edit Profile" to make changes.</div>
</div>
<div class="$$collapse bg-base-100 border border-base-300"> <input type="radio" name="my-accordion-1" checked="checked" /> <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="radio" name="my-accordion-1" /> <div class="$$collapse-title font-semibold">I forgot my password. What should I do?</div> <div class="$$collapse-content text-sm">Click on "Forgot Password" on the login page and follow the instructions sent to your email.</div> </div> <div class="$$collapse bg-base-100 border border-base-300"> <input type="radio" name="my-accordion-1" /> <div class="$$collapse-title font-semibold">How do I update my profile information?</div> <div class="$$collapse-content text-sm">Go to "My Account" settings and select "Edit Profile" to make changes.</div> </div>
<div class="$$collapse bg-base-100 border border-base-300">
<input type="radio" name="my-accordion-1" checked="checked" />
<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="radio" name="my-accordion-1" />
<div class="$$collapse-title font-semibold">I forgot my password. What should I do?</div>
<div class="$$collapse-content text-sm">Click on "Forgot Password" on the login page and follow the instructions sent to your email.</div>
</div>
<div class="$$collapse bg-base-100 border border-base-300">
<input type="radio" name="my-accordion-1" />
<div class="$$collapse-title font-semibold">How do I update my profile information?</div>
<div class="$$collapse-content text-sm">Go to "My Account" settings and select "Edit Profile" to make changes.</div>
</div>
<div class="$$collapse $$collapse-arrow bg-base-100 border border-base-300"> <input type="radio" name="my-accordion-2" checked="checked" /> <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 $$collapse-arrow bg-base-100 border border-base-300"> <input type="radio" name="my-accordion-2" /> <div class="$$collapse-title font-semibold">I forgot my password. What should I do?</div> <div class="$$collapse-content text-sm">Click on "Forgot Password" on the login page and follow the instructions sent to your email.</div> </div> <div class="$$collapse $$collapse-arrow bg-base-100 border border-base-300"> <input type="radio" name="my-accordion-2" /> <div class="$$collapse-title font-semibold">How do I update my profile information?</div> <div class="$$collapse-content text-sm">Go to "My Account" settings and select "Edit Profile" to make changes.</div> </div>
<div class="$$collapse $$collapse-arrow bg-base-100 border border-base-300">
<input type="radio" name="my-accordion-2" checked="checked" />
<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 $$collapse-arrow bg-base-100 border border-base-300">
<input type="radio" name="my-accordion-2" />
<div class="$$collapse-title font-semibold">I forgot my password. What should I do?</div>
<div class="$$collapse-content text-sm">Click on "Forgot Password" on the login page and follow the instructions sent to your email.</div>
</div>
<div class="$$collapse $$collapse-arrow bg-base-100 border border-base-300">
<input type="radio" name="my-accordion-2" />
<div class="$$collapse-title font-semibold">How do I update my profile information?</div>
<div class="$$collapse-content text-sm">Go to "My Account" settings and select "Edit Profile" to make changes.</div>
</div>
<div class="$$collapse $$collapse-arrow bg-base-100 border border-base-300"> <input type="radio" name="my-accordion-2" checked="checked" /> <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 $$collapse-arrow bg-base-100 border border-base-300"> <input type="radio" name="my-accordion-2" /> <div class="$$collapse-title font-semibold">I forgot my password. What should I do?</div> <div class="$$collapse-content text-sm">Click on "Forgot Password" on the login page and follow the instructions sent to your email.</div> </div> <div class="$$collapse $$collapse-arrow bg-base-100 border border-base-300"> <input type="radio" name="my-accordion-2" /> <div class="$$collapse-title font-semibold">How do I update my profile information?</div> <div class="$$collapse-content text-sm">Go to "My Account" settings and select "Edit Profile" to make changes.</div> </div>
<div class="$$collapse $$collapse-arrow bg-base-100 border border-base-300">
<input type="radio" name="my-accordion-2" checked="checked" />
<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 $$collapse-arrow bg-base-100 border border-base-300">
<input type="radio" name="my-accordion-2" />
<div class="$$collapse-title font-semibold">I forgot my password. What should I do?</div>
<div class="$$collapse-content text-sm">Click on "Forgot Password" on the login page and follow the instructions sent to your email.</div>
</div>
<div class="$$collapse $$collapse-arrow bg-base-100 border border-base-300">
<input type="radio" name="my-accordion-2" />
<div class="$$collapse-title font-semibold">How do I update my profile information?</div>
<div class="$$collapse-content text-sm">Go to "My Account" settings and select "Edit Profile" to make changes.</div>
</div>
<div class="$$collapse $$collapse-plus bg-base-100 border border-base-300"> <input type="radio" name="my-accordion-3" checked="checked" /> <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 $$collapse-plus bg-base-100 border border-base-300"> <input type="radio" name="my-accordion-3" /> <div class="$$collapse-title font-semibold">I forgot my password. What should I do?</div> <div class="$$collapse-content text-sm">Click on "Forgot Password" on the login page and follow the instructions sent to your email.</div> </div> <div class="$$collapse $$collapse-plus bg-base-100 border border-base-300"> <input type="radio" name="my-accordion-3" /> <div class="$$collapse-title font-semibold">How do I update my profile information?</div> <div class="$$collapse-content text-sm">Go to "My Account" settings and select "Edit Profile" to make changes.</div> </div>
<div class="$$collapse $$collapse-plus bg-base-100 border border-base-300">
<input type="radio" name="my-accordion-3" checked="checked" />
<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 $$collapse-plus bg-base-100 border border-base-300">
<input type="radio" name="my-accordion-3" />
<div class="$$collapse-title font-semibold">I forgot my password. What should I do?</div>
<div class="$$collapse-content text-sm">Click on "Forgot Password" on the login page and follow the instructions sent to your email.</div>
</div>
<div class="$$collapse $$collapse-plus bg-base-100 border border-base-300">
<input type="radio" name="my-accordion-3" />
<div class="$$collapse-title font-semibold">How do I update my profile information?</div>
<div class="$$collapse-content text-sm">Go to "My Account" settings and select "Edit Profile" to make changes.</div>
</div>
<div class="$$collapse $$collapse-plus bg-base-100 border border-base-300"> <input type="radio" name="my-accordion-3" checked="checked" /> <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 $$collapse-plus bg-base-100 border border-base-300"> <input type="radio" name="my-accordion-3" /> <div class="$$collapse-title font-semibold">I forgot my password. What should I do?</div> <div class="$$collapse-content text-sm">Click on "Forgot Password" on the login page and follow the instructions sent to your email.</div> </div> <div class="$$collapse $$collapse-plus bg-base-100 border border-base-300"> <input type="radio" name="my-accordion-3" /> <div class="$$collapse-title font-semibold">How do I update my profile information?</div> <div class="$$collapse-content text-sm">Go to "My Account" settings and select "Edit Profile" to make changes.</div> </div>
<div class="$$collapse $$collapse-plus bg-base-100 border border-base-300">
<input type="radio" name="my-accordion-3" checked="checked" />
<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 $$collapse-plus bg-base-100 border border-base-300">
<input type="radio" name="my-accordion-3" />
<div class="$$collapse-title font-semibold">I forgot my password. What should I do?</div>
<div class="$$collapse-content text-sm">Click on "Forgot Password" on the login page and follow the instructions sent to your email.</div>
</div>
<div class="$$collapse $$collapse-plus bg-base-100 border border-base-300">
<input type="radio" name="my-accordion-3" />
<div class="$$collapse-title font-semibold">How do I update my profile information?</div>
<div class="$$collapse-content text-sm">Go to "My Account" settings and select "Edit Profile" to make changes.</div>
</div>
<div class="$$join $$join-vertical bg-base-100"> <div class="$$collapse $$collapse-arrow $$join-item border-base-300 border"> <input type="radio" name="my-accordion-4" checked="checked" /> <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 $$collapse-arrow $$join-item border-base-300 border"> <input type="radio" name="my-accordion-4" /> <div class="$$collapse-title font-semibold">I forgot my password. What should I do?</div> <div class="$$collapse-content text-sm">Click on "Forgot Password" on the login page and follow the instructions sent to your email.</div> </div> <div class="$$collapse $$collapse-arrow $$join-item border-base-300 border"> <input type="radio" name="my-accordion-4" /> <div class="$$collapse-title font-semibold">How do I update my profile information?</div> <div class="$$collapse-content text-sm">Go to "My Account" settings and select "Edit Profile" to make changes.</div> </div> </div>
<div class="$$join $$join-vertical bg-base-100">
<div class="$$collapse $$collapse-arrow $$join-item border-base-300 border">
<input type="radio" name="my-accordion-4" checked="checked" />
<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 $$collapse-arrow $$join-item border-base-300 border">
<input type="radio" name="my-accordion-4" />
<div class="$$collapse-title font-semibold">I forgot my password. What should I do?</div>
<div class="$$collapse-content text-sm">Click on "Forgot Password" on the login page and follow the instructions sent to your email.</div>
</div>
<div class="$$collapse $$collapse-arrow $$join-item border-base-300 border">
<input type="radio" name="my-accordion-4" />
<div class="$$collapse-title font-semibold">How do I update my profile information?</div>
<div class="$$collapse-content text-sm">Go to "My Account" settings and select "Edit Profile" to make changes.</div>
</div>
</div>
<div class="$$join $$join-vertical bg-base-100"> <div class="$$collapse $$collapse-arrow $$join-item border-base-300 border"> <input type="radio" name="my-accordion-4" checked="checked" /> <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 $$collapse-arrow $$join-item border-base-300 border"> <input type="radio" name="my-accordion-4" /> <div class="$$collapse-title font-semibold">I forgot my password. What should I do?</div> <div class="$$collapse-content text-sm">Click on "Forgot Password" on the login page and follow the instructions sent to your email.</div> </div> <div class="$$collapse $$collapse-arrow $$join-item border-base-300 border"> <input type="radio" name="my-accordion-4" /> <div class="$$collapse-title font-semibold">How do I update my profile information?</div> <div class="$$collapse-content text-sm">Go to "My Account" settings and select "Edit Profile" to make changes.</div> </div> </div>
<div class="$$join $$join-vertical bg-base-100">
<div class="$$collapse $$collapse-arrow $$join-item border-base-300 border">
<input type="radio" name="my-accordion-4" checked="checked" />
<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 $$collapse-arrow $$join-item border-base-300 border">
<input type="radio" name="my-accordion-4" />
<div class="$$collapse-title font-semibold">I forgot my password. What should I do?</div>
<div class="$$collapse-content text-sm">Click on "Forgot Password" on the login page and follow the instructions sent to your email.</div>
</div>
<div class="$$collapse $$collapse-arrow $$join-item border-base-300 border">
<input type="radio" name="my-accordion-4" />
<div class="$$collapse-title font-semibold">How do I update my profile information?</div>
<div class="$$collapse-content text-sm">Go to "My Account" settings and select "Edit Profile" to make changes.</div>
</div>
</div>