React Aria: Adobe's Hooks-Based Approach
You'll learn how React Aria inverts control through hooks that return prop objects, giving you full rendering freedom.
React Aria is Adobe's headless UI library that takes a hooks-first approach to accessible components. Instead of providing pre-built components like <Dialog> or <Button>, it gives you hooks like useButton(), useDialog(), and useMenu() that return props objects.
The Core Pattern
When you call a React Aria hook, it returns an object (or objects) containing all the props needed for accessibility, interactions, and keyboard navigation. You then spread these props onto your own HTML elements:
import { useButton } from '@react-aria/button';
function MyButton(props) {
const ref = useRef(null);
const { buttonProps } = useButton(props, ref);
return (
<button {...buttonProps} ref={ref} className="my-custom-style">
{props.children}
</button>
);
}
Notice you control everything: the element type, the styling, the structure. React Aria just hands you the correct onClick, onKeyDown, aria-*, role, and other attributes.
Why This Approach?
Think of React Aria hooks as expert consultants that tell you exactly what props your elements need to be accessible and interactive, but they never touch your DOM. You keep full control over rendering—perfect for design systems that need specific markup or styling approaches.
This is pure inversion of control: instead of React Aria rendering its own components that you customize, you render your components and React Aria customizes their behavior through props.
Key Takeaway: React Aria hooks like useButton() and useDialog() return props objects you spread onto your own elements, giving you complete rendering control while the library handles all accessibility and interaction logic.