Accessible Component Contracts: Focus, Keyboard, and ARIA
Accessible components need clear contracts: focus behavior, keyboard support, and ARIA so screen readers and keyboard users get the right behavior. This post covers how to define and implement these contracts for buttons, modals, and custom controls.
What a contract is
A contract is a documented promise: "This component will do X." For accessibility, that means: how focus moves, which keys do what, and what roles/states/labels are exposed. Implement it once in the component; every use gets the same behavior.