Edit page

Button

A button is a widget that enables users to trigger an action or event, such as submitting a form, opening a dialog, canceling an action, or performing a delete operation —WAI-ARIA-Practices-1.1

Please just use a real <button> 🙏 —Tegan Churchill

Basic Usage

What am I? 🤔

Props

children

function({}) | required

This is the only required prop. children is our render prop and must be a function. It is called with an object argument. Passing in an onClick handler will result in spacebar and enter key listeners being applied as well–exactly how native <button> elements work.

propertytypedescription
getPropsfunction(props: object)returns the props for the button element(e.g., a span)