Toggle

Displays a boolean value.

Standard

disabled

sizes

Components of different sizes.

get change

APIs / Schnittstellendokumentation

Toggle.Props

AttributeDescriptionTypeAccepted valuesDefault
checkedchecked or notboolean--
initialCheckedchecked or not on initialboolean-false
onChangechange event handlerToggleEvent--
sizeinput sizeNormalSizes'mini', 'small', 'medium', 'large'medium
disableddisable toggleboolean-false
...native propsLabelHTMLAttributes'from', 'name', 'className', ...-

ToggleEvent

interface ToggleEventTarget {
  checked: boolean
}

export interface ToggleEvent {
  target: ToggleEventTarget
  stopPropagation: () => void
  preventDefault: () => void
  nativeEvent: React.ChangeEvent
}

Co-Creators