Spoiler
Truncates content to `maxLines` with an inline show-more/less toggle (Disclosure).
Usage
Import
import { Spoiler } from "@qeetrix/ui";It can also be imported on its own from @qeetrix/ui/components/spoiler.
Controlled and uncontrolled
Pass the value prop to control it, or the default prop to let the component own it.
| Value | Default | Change |
|---|---|---|
expanded | defaultExpanded | onExpandedChange |
States
hover · focus-visible · expanded
Support
| Feature | Status |
|---|---|
| Right-to-left | Not applicable |
| Dark mode | Supported |
| Density | Not applicable |
| Server rendering | Client component |
| Reduced motion | Supported |
Accessibility
Follows the WAI-ARIA disclosure pattern. Audited.
| Check | Result |
|---|---|
| Semantics | Pass |
| Accessible name | Pass |
| Keyboard | Pass |
| Focus | Pass |
| Screen reader | Pass |
| Right-to-left | Not applicable |
| Reduced motion | Not applicable |
| Forced colours | Pass |
| Contrast | Pass |
Keyboard
Tab Enter SpaceFocus
Each control is a Tab stop, in order.
Tests
Covered by unit, accessibility (axe), interaction and visual tests.