React Form Switch Component API

Form Switch API

Rocket
New Year sale. Skyrocket your business in 2025!
Extra 25% off for all sale items + Free CoreUI Icons PRO with every order!
Limited-time offer for the first 100 customers in 2025. Use code 2025SKY25 at checkout.

Explore the API reference for the React Form Switch component and discover how to effectively utilize its props for customization.

On this page

CFormSwitch#

import { CFormSwitch } from '@coreui/react'
// or
import CFormSwitch from '@coreui/react/src/components/form/CFormSwitch'
PropertyDefaultType
className#-string

A string of all className you want applied to the component.

id#-string

The id global attribute defines an identifier (ID) that must be unique in the whole document.

invalid#-boolean

Set component validation state to invalid.

label#-ReactNode

The element represents a caption for a component.

reverse#-boolean

Put switch on the opposite side.

size#-'lg', 'xl'

Size the component large or extra large. Works only with switch.

type#checkbox'checkbox', 'radio'

Specifies the type of component.

valid#-boolean

Set component validation state to valid.