button-base
v4.9.10arrow_drop_downPrefer ref
instead.
utility to create component types that inherit props from ButtonBase.
This component has an additional overload if the href
prop is set which
can make extension quite tricky
ButtonBase
contains as few styles as possible.
It aims to be a simple building block for creating a button.
It contains a load of style reset and some focus/ripple logic.
Demos:
API:
ButtonBase
contains as few styles as possible.
It aims to be a simple building block for creating a button.
It contains a load of style reset and some focus/ripple logic.
Name | Type | Description |
---|---|---|
action | custom | A ref for imperative actions.
It currently only supports |
buttonRef | custom | Use that prop to pass a ref to the native button component. |
centerRipple | bool | If |
children | node | The content of the component. |
classes (required) | object | Override or extend the styles applied to the component. See CSS API below for more details. |
className | string | |
component | custom | The component used for the root node. Either a string to use a DOM element or a component. |
disabled | bool | If |
disableRipple | bool | If ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
to highlight the element by applying separate styles with the |
disableTouchRipple | bool | If |
focusRipple | bool | If |
focusVisibleClassName | string | This prop can help a person know which element has the keyboard focus.
The class name will be applied when the element gain the focus through a keyboard interaction.
It’s a polyfill for the CSS :focus-visible selector.
The rationale for using this feature is explained here.
A polyfill can be used to apply a |
onBlur | function | |
onClick | function | |
onDragLeave | function | |
onFocus | function | |
onFocusVisible | function | Callback fired when the component is focused with a keyboard.
We trigger a |
onKeyDown | function | |
onKeyUp | function | |
onMouseDown | function | |
onMouseLeave | function | |
onMouseUp | function | |
onTouchEnd | function | |
onTouchMove | function | |
onTouchStart | function | |
role | string | |
tabIndex | number | string | |
TouchRippleProps | object | Props applied to the |
type | 'submit' | 'reset' | 'button' | Used to control the button’s purpose.
This prop passes the value to the |
classes (required) | object | Override or extend the styles applied to the component. See CSS API below for more details. |
in | bool | injected from TransitionGroup |
onExited | function | injected from TransitionGroup |
pulsate | bool | If |
rippleSize | number | Diameter of the ripple. |
rippleX | number | Horizontal position of the ripple center. |
rippleY | number | Vertical position of the ripple center. |
timeout (required) | number | exit delay |
center | bool | If |
classes (required) | object | Override or extend the styles applied to the component. See CSS API below for more details. |
className | string |