Skip to content
Vy logo
  • Identitet
  • Spor
  • Resources
ComponentsUpdated

Switch

Switches let the users choose between yes or no.

FigmaGitHub
This component was updated in version x.y.z and received new functionality.

Code examples

A simple switch

<Switch />

Guidelines

Switches are a component you use to turn a given feature, service, or setting on or off. You can think of them as a slightly more explicit version of a checkbox.

Code

<Switch />

import { Switch } from "@vygruppen/spor-react";

Lets the user turn something on or off

Props

Name
Type
Required?
Description
size"sm" | "md" | "lg"Default "md"
checkedboolean
disabledboolean
invalidboolean
defaultCheckedboolean
onCheckedChange(details: CheckedChangeDetails) => void
labelstring
namestring
asstringEffects the container for the Switch.