Switch

Classes Information

ClassNameDescription
switchSwitch base class
switch-primarySet primary color
switch-secondarySet secondary color
switch-successSet success color
switch-errorSet error color
switch-warningSet warning color
switch-bordered-primaryWith primary border by default
switch-bordered-secondaryWith secondary border by default
switch-bordered-successWith success border by default
switch-bordered-errorWith error border by default
switch-bordered-warningWith warning border by default
switch-ghost-primaryWith border hover effect primary
switch-ghost-secondaryWith border hover effect secondary
switch-ghost-successWith border hover effect success
switch-ghost-errorWith border hover effect error
switch-ghost-warningWith border hover effect warning
switch-xsSet extra small size
switch-smSet small size
switch-mdSet medium size
switch-lgSet large size
switch-xlSet extra large size

Basic Usage

Example Code

html
<input type="checkbox" class="switch" />

Colors

Example Code

html
<input type="checkbox" class="switch switch-primary" checked />
<input type="checkbox" class="switch switch-secondary" checked />
<input type="checkbox" class="switch switch-success" checked />
<input type="checkbox" class="switch switch-error" checked />
<input type="checkbox" class="switch switch-warning" checked />

Bordered

Example Code

html
<input type="checkbox" class="switch switch-bordered-primary" />
<input type="checkbox" class="switch switch-bordered-secondary" />
<input type="checkbox" class="switch switch-bordered-success" />
<input type="checkbox" class="switch switch-bordered-error" />
<input type="checkbox" class="switch switch-bordered-warning" />

Ghost

Example Code

html
<input type="checkbox" class="switch switch-ghost-primary" />
<input type="checkbox" class="switch switch-ghost-secondary" />
<input type="checkbox" class="switch switch-ghost-success" />
<input type="checkbox" class="switch switch-ghost-error" />
<input type="checkbox" class="switch switch-ghost-warning" />

Sizes

Example Code

html
<input type="checkbox" class="switch switch-xl" />
<input type="checkbox" class="switch switch-lg" />
<input type="checkbox" class="switch switch-md" />
<input type="checkbox" class="switch switch-sm" />
<input type="checkbox" class="switch switch-xs" />

Disabled

Example Code

html
<input type="checkbox" class="switch" disabled checked />