Loading…
A short voice session: one question, one follow-up, then instant feedback — up to 5 minutes.
Use a compound API such as Tabs, TabList, Tab and TabPanel sharing state through context, support controlled and uncontrolled modes, and build in the ARIA roles, relationships and arrow-key navigation so consumers get accessibility by default.
A compound component API lets consumers arrange pieces freely while the parent manages state through context, avoiding a long list of configuration props. Supporting both value with onValueChange and a defaultValue lets teams choose controlled or uncontrolled use. Accessibility should be built in: role=tablist, tab and tabpanel, aria-selected, aria-controls and aria-labelledby wired automatically with generated ids, roving tabindex with Arrow, Home and End keys, and an option for manual activation. Document the behaviour, version breaking changes carefully, and back the component with automated accessibility tests and keyboard interaction tests, since many products depend on it.