Toggle is a checkbox that is styled to look like a switch button.
Class name | Type | |
---|---|---|
toggle | Component | For <input type="checkbox"> |
toggle-primary | Color | primary color |
toggle-secondary | Color | secondary color |
toggle-accent | Color | accent color |
toggle-success | Color | success color |
toggle-warning | Color | warning color |
toggle-info | Color | info color |
toggle-error | Color | error color |
toggle-xs | Size | Extra small size |
toggle-sm | Size | Small size |
toggle-md | Size | Medium size (default) |
toggle-lg | Size | Large size |
toggle-xl | Size | Extra large size |
<input type="checkbox" class="$$toggle" checked="checked" />
<input type="checkbox" class="$$toggle" checked="checked" />
<input type="checkbox" class="$$toggle" checked="checked" />
<input type="checkbox" class="$$toggle" checked="checked" />
<div class="$$form-control"> <label class="$$label cursor-pointer"> <span class="$$label-text">Remember me</span> <input type="checkbox" class="$$toggle" checked="checked" /> </label> </div>
<div class="$$form-control">
<label class="$$label cursor-pointer">
<span class="$$label-text">Remember me</span>
<input type="checkbox" class="$$toggle" checked="checked" />
</label>
</div>
<div class="$$form-control"> <label class="$$label cursor-pointer"> <span class="$$label-text">Remember me</span> <input type="checkbox" class="$$toggle" checked="checked" /> </label> </div>
<div class="$$form-control">
<label class="$$label cursor-pointer">
<span class="$$label-text">Remember me</span>
<input type="checkbox" class="$$toggle" checked="checked" />
</label>
</div>
<div class="flex flex-col"> <div class="form-control w-52"> <label class="label cursor-pointer"> <span class="label-text">Remember me</span> <input type="checkbox" class="$$toggle $$toggle-primary" checked="checked" /> </label> </div> <div class="form-control w-52"> <label class="label cursor-pointer"> <span class="label-text">Remember me</span> <input type="checkbox" class="$$toggle $$toggle-secondary" checked="checked" /> </label> </div> <div class="form-control w-52"> <label class="label cursor-pointer"> <span class="label-text">Remember me</span> <input type="checkbox" class="$$toggle $$toggle-accent" checked="checked" /> </label> </div> </div>
<div class="flex flex-col">
<div class="form-control w-52">
<label class="label cursor-pointer">
<span class="label-text">Remember me</span>
<input type="checkbox" class="$$toggle $$toggle-primary" checked="checked" />
</label>
</div>
<div class="form-control w-52">
<label class="label cursor-pointer">
<span class="label-text">Remember me</span>
<input type="checkbox" class="$$toggle $$toggle-secondary" checked="checked" />
</label>
</div>
<div class="form-control w-52">
<label class="label cursor-pointer">
<span class="label-text">Remember me</span>
<input type="checkbox" class="$$toggle $$toggle-accent" checked="checked" />
</label>
</div>
</div>
<div class="flex flex-col"> <div class="form-control w-52"> <label class="label cursor-pointer"> <span class="label-text">Remember me</span> <input type="checkbox" class="$$toggle $$toggle-primary" checked="checked" /> </label> </div> <div class="form-control w-52"> <label class="label cursor-pointer"> <span class="label-text">Remember me</span> <input type="checkbox" class="$$toggle $$toggle-secondary" checked="checked" /> </label> </div> <div class="form-control w-52"> <label class="label cursor-pointer"> <span class="label-text">Remember me</span> <input type="checkbox" class="$$toggle $$toggle-accent" checked="checked" /> </label> </div> </div>
<div class="flex flex-col">
<div class="form-control w-52">
<label class="label cursor-pointer">
<span class="label-text">Remember me</span>
<input type="checkbox" class="$$toggle $$toggle-primary" checked="checked" />
</label>
</div>
<div class="form-control w-52">
<label class="label cursor-pointer">
<span class="label-text">Remember me</span>
<input type="checkbox" class="$$toggle $$toggle-secondary" checked="checked" />
</label>
</div>
<div class="form-control w-52">
<label class="label cursor-pointer">
<span class="label-text">Remember me</span>
<input type="checkbox" class="$$toggle $$toggle-accent" checked="checked" />
</label>
</div>
</div>
<input type="checkbox" class="$$toggle $$toggle-success" checked="checked" /> <input type="checkbox" class="$$toggle $$toggle-warning" checked="checked" /> <input type="checkbox" class="$$toggle $$toggle-info" checked="checked" /> <input type="checkbox" class="$$toggle $$toggle-error" checked="checked" />
<input type="checkbox" class="$$toggle $$toggle-success" checked="checked" />
<input type="checkbox" class="$$toggle $$toggle-warning" checked="checked" />
<input type="checkbox" class="$$toggle $$toggle-info" checked="checked" />
<input type="checkbox" class="$$toggle $$toggle-error" checked="checked" />
<input type="checkbox" class="$$toggle $$toggle-success" checked="checked" /> <input type="checkbox" class="$$toggle $$toggle-warning" checked="checked" /> <input type="checkbox" class="$$toggle $$toggle-info" checked="checked" /> <input type="checkbox" class="$$toggle $$toggle-error" checked="checked" />
<input type="checkbox" class="$$toggle $$toggle-success" checked="checked" />
<input type="checkbox" class="$$toggle $$toggle-warning" checked="checked" />
<input type="checkbox" class="$$toggle $$toggle-info" checked="checked" />
<input type="checkbox" class="$$toggle $$toggle-error" checked="checked" />
<input type="checkbox" class="$$toggle $$toggle-xs" checked="checked" /> <input type="checkbox" class="$$toggle $$toggle-sm" checked="checked" /> <input type="checkbox" class="$$toggle $$toggle-md" checked="checked" /> <input type="checkbox" class="$$toggle $$toggle-lg" checked="checked" />
<input type="checkbox" class="$$toggle $$toggle-xs" checked="checked" />
<input type="checkbox" class="$$toggle $$toggle-sm" checked="checked" />
<input type="checkbox" class="$$toggle $$toggle-md" checked="checked" />
<input type="checkbox" class="$$toggle $$toggle-lg" checked="checked" />
<input type="checkbox" class="$$toggle $$toggle-xs" checked="checked" /> <input type="checkbox" class="$$toggle $$toggle-sm" checked="checked" /> <input type="checkbox" class="$$toggle $$toggle-md" checked="checked" /> <input type="checkbox" class="$$toggle $$toggle-lg" checked="checked" />
<input type="checkbox" class="$$toggle $$toggle-xs" checked="checked" />
<input type="checkbox" class="$$toggle $$toggle-sm" checked="checked" />
<input type="checkbox" class="$$toggle $$toggle-md" checked="checked" />
<input type="checkbox" class="$$toggle $$toggle-lg" checked="checked" />
<input type="checkbox" class="$$toggle" disabled />
<input type="checkbox" class="$$toggle" disabled />
<input type="checkbox" class="$$toggle" disabled />
<input type="checkbox" class="$$toggle" disabled />
<input type="checkbox" class="$$toggle" disabled checked="checked" />
<input type="checkbox" class="$$toggle" disabled checked="checked" />
<input type="checkbox" class="$$toggle" disabled checked="checked" />
<input type="checkbox" class="$$toggle" disabled checked="checked" />
<!-- You can make a toggle indeterminate using JS --> <script> document.getElementById("my-toggle").indeterminate = true </script> <input type="checkbox" class="$$toggle" id="my-toggle" />
<!-- You can make a toggle indeterminate using JS -->
<script>
document.getElementById("my-toggle").indeterminate = true
</script>
<input type="checkbox" class="$$toggle" id="my-toggle" />
<!-- You can make a toggle indeterminate using JS --> <script> document.getElementById("my-toggle").indeterminate = true </script> <input type="checkbox" class="$$toggle" id="my-toggle" />
<!-- You can make a toggle indeterminate using JS -->
<script>
document.getElementById("my-toggle").indeterminate = true
</script>
<input type="checkbox" class="$$toggle" id="my-toggle" />
<input type="checkbox" class="$$toggle border-blue-500 bg-blue-500 [--tglbg:yellow] hover:bg-blue-700" checked="checked" />
<input
type="checkbox"
class="$$toggle border-blue-500 bg-blue-500 [--tglbg:yellow] hover:bg-blue-700"
checked="checked" />
<input type="checkbox" class="$$toggle border-blue-500 bg-blue-500 [--tglbg:yellow] hover:bg-blue-700" checked="checked" />
<input
type="checkbox"
class="$$toggle border-blue-500 bg-blue-500 [--tglbg:yellow] hover:bg-blue-700"
checked="checked" />