Details
Collapsible disclosure built on native details and summary.
c2-details wraps a native <details> / <summary> pair, so keyboard access, screen-reader semantics and find-in-page auto-expand come from the browser. Give panels the same name and they form an exclusive accordion: opening one closes the others. The header is the title slot (or the label attribute) plus an optional header-content row that stays visible when collapsed; buttons and links placed there work without toggling the panel. title-not-clickable limits toggling to the chevron, disabled blocks it. Open and close slide the content smoothly in every browser (--c2-details--transition-duration controls the length, reduced motion disables it), and expanded mirrors the native open state; listen for toggle on the element. Content rendered only once the panel opens (in a toggle listener, by a framework) still slides open: the panel follows content that grows while it opens.
Import
import '@c2n/components/details'Usage
What is included?
Everything in the free plan plus unlimited projects and priority support.
Everything in the free plan plus unlimited projects and priority support.
Visa ending 4242. Invoices are sent to billing@example.com.
BillingNext invoice on 1 OctVisa ending 4242. Invoices are sent to billing@example.com.
BillingNext invoice on 1 Oct
Can I cancel anytime?
Yes. Your plan stays active until the end of the period.
Yes. Your plan stays active until the end of the period.
Do you offer refunds?
Within 14 days, no questions asked.
Within 14 days, no questions asked.
Is there a student discount?
50% off with a valid student email.
50% off with a valid student email.
Only the chevron toggles
Clicks on the title are ignored.
Clicks on the title are ignored.
Plus and minus
The expanded-icon slot replaces the rotation.
The expanded-icon slot replaces the rotation.
Archived section
Never shown.
Never shown.