• What is KendoReact
  • Getting Started
  • Server Components
  • Components
    • Animation
    • Barcodes
    • Buttons
    • Chartsupdated
    • Common Utilities
    • Conversational UIupdated
    • Data Gridupdated
    • Data Query
    • Data Tools
    • Date Inputs
    • Date Math
    • Dialogs
    • Drawing
    • Dropdownsupdated
    • Editor
    • Excel Export
    • File Saver
    • Formupdated
    • Ganttupdated
    • Gauges
    • Indicators
    • Inputsupdated
    • Labels
    • Layoutupdated
    • ListBox
    • ListView
    • Map
    • Notification
    • OrgChartnew
    • PDF Processing
    • PDFViewer
    • PivotGrid
    • Popup
    • Progress Bars
    • Ripple
    • Scheduler
    • ScrollView
    • Sortable
    • Spreadsheetupdated
    • TaskBoard
    • Tooltips
    • TreeList
    • TreeViewupdated
    • Upload
  • Sample Applications
  • Styling & Themes
  • Common Features
  • Project Setup
  • Knowledge Base
  • Changelog
  • Updates
  • Troubleshooting

SwitchProps

Represents the props of the KendoReact Switch component.

NameTypeDefaultDescription

accessKey?

string

Specifies the accessKey of the Switch.

ariaDescribedBy?

string

Identifies the element(s) which will describe the component, similar to HTML aria-describedby attribute. For example these elements could contain error or hint message.

ariaLabel?

string

The accessible label of the component.

ariaLabelledBy?

string

Identifies the element(s) which will label the component.

checked?

boolean

Sets the current value of the Switch (see example).

className?

string

Sets the className of the wrapping element of the Switch.

defaultChecked?

boolean

Sets the value of the Switch when it is initially displayed (see example).

defaultValue?

any

Sets the default value of the Switch.

dir?

string

Sets the dir property of the wrapping element of the Switch.

disabled?

boolean

Disables the Switch when set to true (see example).

id?

string

Sets the id of the Switch.

name?

string

Specifies the name property of the input DOM element.

This property is part of the FormComponentProps interface.

offLabel?

string

Changes the Off label(see example).

onBlur?

(event: FocusEvent<HTMLSpanElement>) => void

Fires each time the Switch gets blurred.

onChange?

(event: SwitchChangeEvent) => void

Fires each time the user selects a new value (see example).

onFocus?

(event: FocusEvent<HTMLSpanElement>) => void

Fires each time the Switch component gets focused.

onLabel?

string

Changes the On label (see example).

required?

boolean

Specifies if null is a valid value for the component.

This property is part of the FormComponentProps interface.

size?

"null" | "small" | "large" | "medium"

medium

Configures the size of the Switch.

The available options are:

  • small
  • medium
  • large
  • null—Does not set a size className.

tabIndex?

number

Specifies the tabIndex of the component.

thumbRounded?

"null" | "small" | "large" | "medium" | "full"

full

Configures the thumbRounded of the Switch.

The available options are:

  • small
  • medium
  • large
  • full
  • null—Does not set a thumbRounded className.

trackRounded?

"null" | "small" | "large" | "medium" | "full"

full

Configures the trackRounded of the Switch.

The available options are:

  • small
  • medium
  • large
  • full
  • null—Does not set a trackRounded className.

valid?

boolean

Overrides the validity state of the component. If valid is set, the required property will be ignored.

This property is part of the FormComponentProps interface.

validationMessage?

string

Controls the form error message of the component. If set to an empty string, no error will be thrown.

This property is part of the FormComponentProps interface.

validityStyles?

boolean

If set to false, no visual representation of the invalid state of the component will be applied.

This property is part of the FormComponentProps interface.

value?

"null" | string | number | boolean | string[]

Sets the value of the Switch. It can either be of the primitive (string, number, boolean) or of the complex (array) type.