折叠面板组件用于显示和隐藏内容,但一次只能保持一个项目打开状态。
类名 | 类型 | |
---|---|---|
collapse | 组件 | Collapse |
collapse-title | 部分 | 标题部分 |
collapse-content | 部分 | 内容部分 |
collapse-arrow | 修饰符 | 添加箭头图标 |
collapse-plus | 修饰符 | 添加加号/减号图标 |
collapse-open | 修饰符 | 强制打开 |
collapse-close | 修饰符 | 强制关闭 |
折叠面板使用与collapse 组件相同的样式,但它可以使用单选输入框。您可以通过选中/取消选中隐藏的单选输入框来控制哪个项目处于打开状态。
所有具有相同名称的单选输入框协同工作,并且一次只能打开其中一个。如果页面上有多个折叠面板项集,请为每个集上的单选输入框使用不同的名称。
<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>