Edit page

Switch

Base on https://material-ui.com/components/switches/

Related component

Icon

Basic usage

import { Switch } from '@doopage/react-ui-kit'
const Example = () => <Switch />;
export default Example;

Playground

Basic

With label

Size

With helperText

Label placement

Properties

Prop nameTypeDefaultRequiredDescription
hideboolean | undefinedfalse
color"info" | "success" | "danger" | "warning" | "primary" | "white" | "rose" | "gray" | undefinedfalse
helperTextstring | undefinedfalse
labelstring | undefinedfalse
stylesanyfalse
formPropsFormControlLabelProps | undefinedfalse
labelPlacement"bottom" | "top" | "start" | "end" | undefinedfalse
titlestring | undefinedfalse
disabledboolean | undefinedfalse

If true, the switch will be disabled.

onChange((event: ChangeEvent<HTMLInputElement>, checked: boolean) => void) | undefinedfalse

Callback fired when the state is changed. @param event The event source of the callback. You can pull out the new value by accessing event.target.value (string). You can pull out the new checked state by accessing event.target.checked (boolean).

classesPartial<Record<SwitchClassKey, string>> | undefinedfalse

Override or extend the styles applied to the component.

defaultCheckedboolean | undefinedfalse
defaultValuestring | number | readonly string[] | undefinedfalse
suppressContentEditableWarningboolean | undefinedfalse
suppressHydrationWarningboolean | undefinedfalse
accessKeystring | undefinedfalse
classNamestring | undefinedfalse
contentEditableboolean | "true" | "false" | "inherit" | undefinedfalse
contextMenustring | undefinedfalse
dirstring | undefinedfalse
draggableboolean | "true" | "false" | undefinedfalse
hiddenboolean | undefinedfalse
idstring | undefinedfalse

The id of the input element.

langstring | undefinedfalse
placeholderstring | undefinedfalse
slotstring | undefinedfalse
spellCheckboolean | "true" | "false" | undefinedfalse
styleCSSProperties | undefinedfalse
tabIndexnumber | undefinedfalse
translate"yes" | "no" | undefinedfalse
radioGroupstring | undefinedfalse
rolestring | undefinedfalse
aboutstring | undefinedfalse
datatypestring | undefinedfalse
inlistanyfalse
prefixstring | undefinedfalse
propertystring | undefinedfalse
resourcestring | undefinedfalse
typeofstring | undefinedfalse
vocabstring | undefinedfalse
autoCapitalizestring | undefinedfalse
autoCorrectstring | undefinedfalse
autoSavestring | undefinedfalse
itemPropstring | undefinedfalse
itemScopeboolean | undefinedfalse
itemTypestring | undefinedfalse
itemIDstring | undefinedfalse
itemRefstring | undefinedfalse
resultsnumber | undefinedfalse
securitystring | undefinedfalse
unselectable"on" | "off" | undefinedfalse
inputMode"none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefinedfalse

Hints at the type of data that might be entered by the user while editing the element or its contents @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute

isstring | undefinedfalse

Specify that a standard HTML element should behave like a defined custom built-in element @see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is

aria-activedescendantstring | undefinedfalse

Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.

aria-atomicboolean | "true" | "false" | undefinedfalse

Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.

aria-autocomplete"none" | "inline" | "list" | "both" | undefinedfalse

Indicates whether inputting text could trigger display of one or more predictions of the user’s intended value for an input and specifies how predictions would be presented if they are made.

aria-busyboolean | "true" | "false" | undefinedfalse

Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user.

aria-checkedboolean | "true" | "false" | "mixed" | undefinedfalse

Indicates the current “checked” state of checkboxes, radio buttons, and other widgets. @see aria-pressed @see aria-selected.

aria-colcountnumber | undefinedfalse

Defines the total number of columns in a table, grid, or treegrid. @see aria-colindex.

aria-colindexnumber | undefinedfalse

Defines an element’s column index or position with respect to the total number of columns within a table, grid, or treegrid. @see aria-colcount @see aria-colspan.

aria-colspannumber | undefinedfalse

Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid. @see aria-colindex @see aria-rowspan.

aria-controlsstring | undefinedfalse

Identifies the element (or elements) whose contents or presence are controlled by the current element. @see aria-owns.

aria-currentboolean | "true" | "false" | "page" | "step" | "location" | "date" | "time" | undefinedfalse

Indicates the element that represents the current item within a container or set of related elements.

aria-describedbystring | undefinedfalse

Identifies the element (or elements) that describes the object. @see aria-labelledby

aria-detailsstring | undefinedfalse

Identifies the element that provides a detailed, extended description for the object. @see aria-describedby.

aria-disabledboolean | "true" | "false" | undefinedfalse

Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable. @see aria-hidden @see aria-readonly.

aria-dropeffect"none" | "copy" | "execute" | "link" | "move" | "popup" | undefinedfalse

Indicates what functions can be performed when a dragged object is released on the drop target. @deprecated in ARIA 1.1

aria-errormessagestring | undefinedfalse

Identifies the element that provides an error message for the object. @see aria-invalid @see aria-describedby.

aria-expandedboolean | "true" | "false" | undefinedfalse

Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.

aria-flowtostring | undefinedfalse

Identifies the next element (or elements) in an alternate reading order of content which, at the user’s discretion, allows assistive technology to override the general default of reading in document source order.

aria-grabbedboolean | "true" | "false" | undefinedfalse

Indicates an element’s “grabbed” state in a drag-and-drop operation. @deprecated in ARIA 1.1

aria-haspopupboolean | "true" | "false" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefinedfalse

Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.

aria-hiddenboolean | "true" | "false" | undefinedfalse

Indicates whether the element is exposed to an accessibility API. @see aria-disabled.

aria-invalidboolean | "true" | "false" | "grammar" | "spelling" | undefinedfalse

Indicates the entered value does not conform to the format expected by the application. @see aria-errormessage.

aria-keyshortcutsstring | undefinedfalse

Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.

aria-labelstring | undefinedfalse

Defines a string value that labels the current element. @see aria-labelledby.

aria-labelledbystring | undefinedfalse

Identifies the element (or elements) that labels the current element. @see aria-describedby.

aria-levelnumber | undefinedfalse

Defines the hierarchical level of an element within a structure.

aria-live"off" | "assertive" | "polite" | undefinedfalse

Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.

aria-modalboolean | "true" | "false" | undefinedfalse

Indicates whether an element is modal when displayed.

aria-multilineboolean | "true" | "false" | undefinedfalse

Indicates whether a text box accepts multiple lines of input or only a single line.

aria-multiselectableboolean | "true" | "false" | undefinedfalse

Indicates that the user may select more than one item from the current selectable descendants.

aria-orientation"horizontal" | "vertical" | undefinedfalse

Indicates whether the element’s orientation is horizontal, vertical, or unknown/ambiguous.

aria-ownsstring | undefinedfalse

Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship between DOM elements where the DOM hierarchy cannot be used to represent the relationship. @see aria-controls.

aria-placeholderstring | undefinedfalse

Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format.

aria-posinsetnumber | undefinedfalse

Defines an element’s number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. @see aria-setsize.

aria-pressedboolean | "true" | "false" | "mixed" | undefinedfalse

Indicates the current “pressed” state of toggle buttons. @see aria-checked @see aria-selected.

aria-readonlyboolean | "true" | "false" | undefinedfalse

Indicates that the element is not editable, but is otherwise operable. @see aria-disabled.

aria-relevant"text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefinedfalse

Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified. @see aria-atomic.

aria-requiredboolean | "true" | "false" | undefinedfalse

Indicates that user input is required on the element before a form may be submitted.

aria-roledescriptionstring | undefinedfalse

Defines a human-readable, author-localized description for the role of an element.

aria-rowcountnumber | undefinedfalse

Defines the total number of rows in a table, grid, or treegrid. @see aria-rowindex.

aria-rowindexnumber | undefinedfalse

Defines an element’s row index or position with respect to the total number of rows within a table, grid, or treegrid. @see aria-rowcount @see aria-rowspan.

aria-rowspannumber | undefinedfalse

Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid. @see aria-rowindex @see aria-colspan.

aria-selectedboolean | "true" | "false" | undefinedfalse

Indicates the current “selected” state of various widgets. @see aria-checked @see aria-pressed.

aria-setsizenumber | undefinedfalse

Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. @see aria-posinset.

aria-sort"none" | "ascending" | "descending" | "other" | undefinedfalse

Indicates if items in a table or grid are sorted in ascending or descending order.

aria-valuemaxnumber | undefinedfalse

Defines the maximum allowed value for a range widget.

aria-valueminnumber | undefinedfalse

Defines the minimum allowed value for a range widget.

aria-valuenownumber | undefinedfalse

Defines the current value for a range widget. @see aria-valuetext.

aria-valuetextstring | undefinedfalse

Defines the human readable text alternative of aria-valuenow for a range widget.

dangerouslySetInnerHTML{ __html: string; } | undefinedfalse
onCopy((event: ClipboardEvent<HTMLButtonElement>) => void) | undefinedfalse
onCopyCapture((event: ClipboardEvent<HTMLButtonElement>) => void) | undefinedfalse
onCut((event: ClipboardEvent<HTMLButtonElement>) => void) | undefinedfalse
onCutCapture((event: ClipboardEvent<HTMLButtonElement>) => void) | undefinedfalse
onPaste((event: ClipboardEvent<HTMLButtonElement>) => void) | undefinedfalse
onPasteCapture((event: ClipboardEvent<HTMLButtonElement>) => void) | undefinedfalse
onCompositionEnd((event: CompositionEvent<HTMLButtonElement>) => void) | undefinedfalse
onCompositionEndCapture((event: CompositionEvent<HTMLButtonElement>) => void) | undefinedfalse
onCompositionStart((event: CompositionEvent<HTMLButtonElement>) => void) | undefinedfalse
onCompositionStartCapture((event: CompositionEvent<HTMLButtonElement>) => void) | undefinedfalse
onCompositionUpdate((event: CompositionEvent<HTMLButtonElement>) => void) | undefinedfalse
onCompositionUpdateCapture((event: CompositionEvent<HTMLButtonElement>) => void) | undefinedfalse
onFocus((event: FocusEvent<HTMLButtonElement>) => void) | undefinedfalse
onFocusCapture((event: FocusEvent<HTMLButtonElement>) => void) | undefinedfalse
onBlur((event: FocusEvent<HTMLButtonElement>) => void) | undefinedfalse
onBlurCapture((event: FocusEvent<HTMLButtonElement>) => void) | undefinedfalse
onChangeCapture((event: FormEvent<HTMLButtonElement>) => void) | undefinedfalse
onBeforeInput((event: FormEvent<HTMLButtonElement>) => void) | undefinedfalse
onBeforeInputCapture((event: FormEvent<HTMLButtonElement>) => void) | undefinedfalse
onInput((event: FormEvent<HTMLButtonElement>) => void) | undefinedfalse
onInputCapture((event: FormEvent<HTMLButtonElement>) => void) | undefinedfalse
onReset((event: FormEvent<HTMLButtonElement>) => void) | undefinedfalse
onResetCapture((event: FormEvent<HTMLButtonElement>) => void) | undefinedfalse
onSubmit((event: FormEvent<HTMLButtonElement>) => void) | undefinedfalse
onSubmitCapture((event: FormEvent<HTMLButtonElement>) => void) | undefinedfalse
onInvalid((event: FormEvent<HTMLButtonElement>) => void) | undefinedfalse
onInvalidCapture((event: FormEvent<HTMLButtonElement>) => void) | undefinedfalse
onLoad((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onLoadCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onError((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onErrorCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onKeyDown((event: KeyboardEvent<HTMLButtonElement>) => void) | undefinedfalse
onKeyDownCapture((event: KeyboardEvent<HTMLButtonElement>) => void) | undefinedfalse
onKeyPress((event: KeyboardEvent<HTMLButtonElement>) => void) | undefinedfalse
onKeyPressCapture((event: KeyboardEvent<HTMLButtonElement>) => void) | undefinedfalse
onKeyUp((event: KeyboardEvent<HTMLButtonElement>) => void) | undefinedfalse
onKeyUpCapture((event: KeyboardEvent<HTMLButtonElement>) => void) | undefinedfalse
onAbort((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onAbortCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onCanPlay((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onCanPlayCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onCanPlayThrough((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onCanPlayThroughCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onDurationChange((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onDurationChangeCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onEmptied((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onEmptiedCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onEncrypted((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onEncryptedCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onEnded((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onEndedCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onLoadedData((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onLoadedDataCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onLoadedMetadata((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onLoadedMetadataCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onLoadStart((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onLoadStartCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onPause((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onPauseCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onPlay((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onPlayCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onPlaying((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onPlayingCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onProgress((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onProgressCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onRateChange((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onRateChangeCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onSeeked((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onSeekedCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onSeeking((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onSeekingCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onStalled((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onStalledCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onSuspend((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onSuspendCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onTimeUpdate((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onTimeUpdateCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onVolumeChange((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onVolumeChangeCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onWaiting((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onWaitingCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onAuxClick((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefinedfalse
onAuxClickCapture((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefinedfalse
onClick((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefinedfalse
onClickCapture((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefinedfalse
onContextMenu((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefinedfalse
onContextMenuCapture((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefinedfalse
onDoubleClick((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefinedfalse
onDoubleClickCapture((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefinedfalse
onDrag((event: DragEvent<HTMLButtonElement>) => void) | undefinedfalse
onDragCapture((event: DragEvent<HTMLButtonElement>) => void) | undefinedfalse
onDragEnd((event: DragEvent<HTMLButtonElement>) => void) | undefinedfalse
onDragEndCapture((event: DragEvent<HTMLButtonElement>) => void) | undefinedfalse
onDragEnter((event: DragEvent<HTMLButtonElement>) => void) | undefinedfalse
onDragEnterCapture((event: DragEvent<HTMLButtonElement>) => void) | undefinedfalse
onDragExit((event: DragEvent<HTMLButtonElement>) => void) | undefinedfalse
onDragExitCapture((event: DragEvent<HTMLButtonElement>) => void) | undefinedfalse
onDragLeave((event: DragEvent<HTMLButtonElement>) => void) | undefinedfalse
onDragLeaveCapture((event: DragEvent<HTMLButtonElement>) => void) | undefinedfalse
onDragOver((event: DragEvent<HTMLButtonElement>) => void) | undefinedfalse
onDragOverCapture((event: DragEvent<HTMLButtonElement>) => void) | undefinedfalse
onDragStart((event: DragEvent<HTMLButtonElement>) => void) | undefinedfalse
onDragStartCapture((event: DragEvent<HTMLButtonElement>) => void) | undefinedfalse
onDrop((event: DragEvent<HTMLButtonElement>) => void) | undefinedfalse
onDropCapture((event: DragEvent<HTMLButtonElement>) => void) | undefinedfalse
onMouseDown((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefinedfalse
onMouseDownCapture((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefinedfalse
onMouseEnter((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefinedfalse
onMouseLeave((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefinedfalse
onMouseMove((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefinedfalse
onMouseMoveCapture((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefinedfalse
onMouseOut((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefinedfalse
onMouseOutCapture((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefinedfalse
onMouseOver((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefinedfalse
onMouseOverCapture((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefinedfalse
onMouseUp((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefinedfalse
onMouseUpCapture((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefinedfalse
onSelect((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onSelectCapture((event: SyntheticEvent<HTMLButtonElement, Event>) => void) | undefinedfalse
onTouchCancel((event: TouchEvent<HTMLButtonElement>) => void) | undefinedfalse
onTouchCancelCapture((event: TouchEvent<HTMLButtonElement>) => void) | undefinedfalse
onTouchEnd((event: TouchEvent<HTMLButtonElement>) => void) | undefinedfalse
onTouchEndCapture((event: TouchEvent<HTMLButtonElement>) => void) | undefinedfalse
onTouchMove((event: TouchEvent<HTMLButtonElement>) => void) | undefinedfalse
onTouchMoveCapture((event: TouchEvent<HTMLButtonElement>) => void) | undefinedfalse
onTouchStart((event: TouchEvent<HTMLButtonElement>) => void) | undefinedfalse
onTouchStartCapture((event: TouchEvent<HTMLButtonElement>) => void) | undefinedfalse
onPointerDown((event: PointerEvent<HTMLButtonElement>) => void) | undefinedfalse
onPointerDownCapture((event: PointerEvent<HTMLButtonElement>) => void) | undefinedfalse
onPointerMove((event: PointerEvent<HTMLButtonElement>) => void) | undefinedfalse
onPointerMoveCapture((event: PointerEvent<HTMLButtonElement>) => void) | undefinedfalse
onPointerUp((event: PointerEvent<HTMLButtonElement>) => void) | undefinedfalse
onPointerUpCapture((event: PointerEvent<HTMLButtonElement>) => void) | undefinedfalse
onPointerCancel((event: PointerEvent<HTMLButtonElement>) => void) | undefinedfalse
onPointerCancelCapture((event: PointerEvent<HTMLButtonElement>) => void) | undefinedfalse
onPointerEnter((event: PointerEvent<HTMLButtonElement>) => void) | undefinedfalse
onPointerEnterCapture((event: PointerEvent<HTMLButtonElement>) => void) | undefinedfalse
onPointerLeave((event: PointerEvent<HTMLButtonElement>) => void) | undefinedfalse
onPointerLeaveCapture((event: PointerEvent<HTMLButtonElement>) => void) | undefinedfalse
onPointerOver((event: PointerEvent<HTMLButtonElement>) => void) | undefinedfalse
onPointerOverCapture((event: PointerEvent<HTMLButtonElement>) => void) | undefinedfalse
onPointerOut((event: PointerEvent<HTMLButtonElement>) => void) | undefinedfalse
onPointerOutCapture((event: PointerEvent<HTMLButtonElement>) => void) | undefinedfalse
onGotPointerCapture((event: PointerEvent<HTMLButtonElement>) => void) | undefinedfalse
onGotPointerCaptureCapture((event: PointerEvent<HTMLButtonElement>) => void) | undefinedfalse
onLostPointerCapture((event: PointerEvent<HTMLButtonElement>) => void) | undefinedfalse
onLostPointerCaptureCapture((event: PointerEvent<HTMLButtonElement>) => void) | undefinedfalse
onScroll((event: UIEvent<HTMLButtonElement, UIEvent>) => void) | undefinedfalse
onScrollCapture((event: UIEvent<HTMLButtonElement, UIEvent>) => void) | undefinedfalse
onWheel((event: WheelEvent<HTMLButtonElement>) => void) | undefinedfalse
onWheelCapture((event: WheelEvent<HTMLButtonElement>) => void) | undefinedfalse
onAnimationStart((event: AnimationEvent<HTMLButtonElement>) => void) | undefinedfalse
onAnimationStartCapture((event: AnimationEvent<HTMLButtonElement>) => void) | undefinedfalse
onAnimationEnd((event: AnimationEvent<HTMLButtonElement>) => void) | undefinedfalse
onAnimationEndCapture((event: AnimationEvent<HTMLButtonElement>) => void) | undefinedfalse
onAnimationIteration((event: AnimationEvent<HTMLButtonElement>) => void) | undefinedfalse
onAnimationIterationCapture((event: AnimationEvent<HTMLButtonElement>) => void) | undefinedfalse
onTransitionEnd((event: TransitionEvent<HTMLButtonElement>) => void) | undefinedfalse
onTransitionEndCapture((event: TransitionEvent<HTMLButtonElement>) => void) | undefinedfalse
innerRef((instance: any) => void) | RefObject<any> | null | undefinedfalse
ref((instance: HTMLButtonElement | null) => void) | RefObject<HTMLButtonElement> | null | undefinedfalse
formstring | undefinedfalse
size"small" | "medium" | undefinedfalse

The size of the switch. small is equivalent to the dense switch styling.

valueunknownfalse

The value of the component. The DOM API casts this to a string. The browser uses “on” as the default value.

keystring | number | null | undefinedfalse
autoFocusboolean | undefinedfalse
formActionstring | undefinedfalse
formEncTypestring | undefinedfalse
formMethodstring | undefinedfalse
formNoValidateboolean | undefinedfalse
formTargetstring | undefinedfalse
namestring | undefinedfalse

Name attribute of the input element.

typestring | undefinedfalse
disableFocusRippleboolean | undefinedfalse
action((instance: ButtonBaseActions | null) => void) | RefObject<ButtonBaseActions> | null | undefinedfalse

A ref for imperative actions. It currently only supports focusVisible() action.

buttonRef((instance: unknown) => void) | RefObject<unknown> | null | undefinedfalse

@ignore Use that prop to pass a ref to the native button component. @deprecated Use ref instead.

centerRippleboolean | undefinedfalse

If true, the ripples will be centered. They won’t start at the cursor interaction position.

disableRippleboolean | undefinedfalse

If true, the ripple effect will be disabled.

disableTouchRippleboolean | undefinedfalse

If true, the touch ripple effect will be disabled.

focusRippleboolean | undefinedfalse

If true, the base button will have a keyboard focus ripple.

focusVisibleClassNamestring | undefinedfalse

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 focus-visible class to other components if needed.

onFocusVisible((event: FocusEvent<any>) => void) | undefinedfalse

Callback fired when the component is focused with a keyboard. We trigger a onFocus callback too.

TouchRipplePropsPartial<TouchRippleProps> | undefinedfalse

Props applied to the TouchRipple element.

checkedboolean | undefinedfalse

If true, the component is checked.

checkedIconReactNodefalse

The icon to display when the component is checked.

iconReactNodefalse

The icon to display when the component is unchecked.

edgefalse | "start" | "end" | undefinedfalse

If given, uses a negative margin to counteract the padding on one side (this is often helpful for aligning the left or right side of the icon with content above or below, without ruining the border size and shape).

inputPropsInputHTMLAttributes<HTMLInputElement> | undefinedfalse

Attributes applied to the input element.

inputRef((instance: any) => void) | RefObject<any> | null | undefinedfalse

Pass a ref to the input element.

readOnlyboolean | undefinedfalse
requiredboolean | undefinedfalse

If true, the input element will be required.