Support CoreUI Development

CoreUI is an MIT-licensed open source project and is completely free to use. However, the amount of effort needed to maintain and develop new features for the project is not sustainable without proper financial backing.

You can support our Open Source software development in the following ways:

  • Buy the CoreUI PRO, and get access to PRO components, and dedicated support.
  • Hire Us! We create stunning designs, high-conversion landing pages, functional mobile apps and reliable web services – everything you need to offer your products or services online and always stay a tap away from your customers.
  • Give us a star ⭐️ on Github.

React Switch Components

Create consistent cross-browser and cross-device switch component.

Other frameworks

CoreUI components are available as native Angular, Bootstrap (Vanilla JS), and Vue components. To learn more please visit the following pages.

Switches#

1<CFormSwitch label="Default switch checkbox input" id="formSwitchCheckDefault"/>
2<CFormSwitch label="Checked switch checkbox input" id="formSwitchCheckChecked" defaultChecked/>
3<CFormSwitch label="Disabled switch checkbox input" id="formSwitchCheckDisabled" disabled/>
4<CFormSwitch label="Disabled checked switch checkbox input" id="formSwitchCheckCheckedDisabled" defaultChecked disabled/>

Sizes#

1<CFormSwitch label="Default switch checkbox input" id="formSwitchCheckDefaultNormal"/>
2<CFormSwitch size="lg" label="Large switch checkbox input" id="formSwitchCheckDefaultLg"/>
3<CFormSwitch size="xl" label="Extra large switch checkbox input" id="formSwitchCheckDefaultXL"/>

API#

CFormSwitch#

1import { CFormSwitch } from '@coreui/react'
2// or
3import CFormSwitch from '@coreui/react/src/components/form/CFormSwitch'
PropertyDescriptionTypeDefault
classNameA string of all className you want applied to the component.string-
idThe id global attribute defines an identifier (ID) that must be unique in the whole document.string-
invalidSet component validation state to invalid.boolean-
labelThe element represents a caption for a component.ReactNode-
sizeSize the component large or extra large. Works only with switch'lg' | 'xl'-
typeSpecifies the type of component.'checkbox' | 'radio'checkbox
validSet component validation state to valid.boolean-