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
<Button> {({ getProps }) => ( <span {getProps({ onClick: () => alert("💁• I'm a button in <span>'s clothing"), })} > What am I? 🤔 </span> )}</Button>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.
| property | type | description |
|---|---|---|
getProps | function(props: object) | returns the props for the button element(e.g., a span) |