About this set
Two cards that expand in place to show more detail, one open and one closed, as used for plan comparisons, FAQs and settings explanations. Each card header has an icon tile, a title, a one-line hint and a chevron that turns over when the card is open. They are built on the native details and summary elements, so opening and closing works with no JavaScript, from the keyboard with Enter or Space, and with find in page, and the open state is exposed to assistive technology by the browser. The panel animates on the ::details-content pseudo-element: its grid rows go from 0fr to 1fr, and content-visibility is transitioned with allow-discrete so the content stays visible while it closes. Chromium browsers animate both opening and closing, Safari animates opening, and browsers without ::details-content open and close instantly, which is a safe fallback. The Bootstrap version wraps the same details in a .card, which avoids needing the Bootstrap bundle for .collapse; the Tailwind version uses the details-content:, open: and group-open: variants.
What’s included
- Native details and summary, no JavaScript
- Grid-rows animation on ::details-content
- Chevron rotates with the open state
- Works with Enter, Space and find in page
- Animations switched off under reduced motion
Accessibility
The summary is the disclosure control, so its title and hint form the accessible name and the browser reports expanded or collapsed. The icon and chevron are aria-hidden. The summary shows a 2px indigo outline on keyboard focus. The grey hint and chevron were darkened to meet contrast, and every transition, including the panel animation, is removed under prefers-reduced-motion.
Customise it
The animation length is the .28s on details::details-content (details-content:duration-[280ms] in Tailwind). The icon tile uses #eef2ff and #4f46e5, and the 72px left padding on .inner lines the text up with the title.




















