New to Kendo UI for Vue? Start a free 30-day trial

Appearance

The Switch provides a predefined set of appearance options.

Apart from the default vision of the Switch, these alternative styling options enable you to configure each individual aspect of the component's appearance.

The current article provides details about how the component changes when the different configurations of its properties are applied. Here are the sections you can directly access:

Configurator demo

The following example demonstrates configuring different aspects of a Switch appearance through a configurator.

Example
View Source
Change Theme:

Size

The size of the Switch is controlled through its size property. The values we can pass to the property are as follows:

  • small — Sets the padding to 2px and 8px.
  • medium(Default) — Sets the padding to 4px and 8px.
  • large — Sets the padding to 6px and 8px.
  • null — Passing null to the size property gives us the option to define a custom CSS class that sets the padding of the Switch.

The following example demonstrates the usage of each size option:

Example
View Source
Change Theme:

Track roundness

The track roundness of the Switch is controlled through its trackRounded property. The values we can pass to the property are as follows:

  • small — Sets the border radius to 1px.
  • medium(Default) — Sets the border radius to 2px.
  • large — Sets the border radius to 4px.
  • full — Sets the border radius to 9999px.
  • null — Passing null to the trackRounded property gives us the option to define a custom CSS class that defines the border-radius of the Switch track.

The following example demonstrates the usage of each trackRounded option:

Example
View Source
Change Theme:

Thumb roundness

The thumb roundness of the Switch is controlled through its thumbRounded property. The values we can pass to the property are as follows:

  • small — Sets the border radius to 1px.
  • medium(Default) — Sets the border radius to 2px.
  • large — Sets the border radius to 4px.
  • full — Sets the border radius to 9999px.
  • null — Passing null to the thumbRounded property gives us the option to define a custom CSS class that defines the border-radius of the Switch thumb.

The following example demonstrates the usage of each thumbRounded option:

Example
View Source
Change Theme: