Compound Component API
Refactor a leaky Tabs component into a stable compound API with React context.
Architecture drill
You inherit Modal.jsx with 12 props: isOpen, onClose, title, footer, showClose, size, variant, primaryAction, secondaryAction, loading, trapFocus, className. Product wants flexible layout slots.
Which API shape do you recommend for long-term platform stability?
How labs work
- Follow the steps in the task panel.
- Edit the highlighted file — usually
Tabs.jsx. - Watch the preview update as you type.
- Run tests when you think you are done.
- Open hints if you get stuck — they reveal one at a time.
Checkpoints
- ›Public API exports Tabs compound components only
- ›Clicking tabs switches visible panel
- ›All Sandpack tests pass