Component

Checkbox Styled Input

Styled checkbox components with various designs and descriptions

  • Component
  • Tailwind
  • MIT

Preview

Live component

Interactive preview
Open preview
9:41 100%
devsnips.dev/library/tailwind/components/input/checkbox-styled/
fluid · no fixed width 100%
No dependencies Production-ready

Install

Add to your project

terminal
npx devsnips add Tailwind/Components/Input/checkbox-styled
registry path: Tailwind/Components/Input/checkbox-styled

Source

Implementation

code.html
<!-- Checkbox - Default Styled -->
<div class="space-y-3">
  <label class="flex items-center gap-3 cursor-pointer">
    <input type="checkbox" class="w-5 h-5 rounded border-gray-300 text-blue-600 focus:ring-blue-500" />
    <span class="text-sm text-gray-700">Accept terms and conditions</span>
  </label>
  <label class="flex items-center gap-3 cursor-pointer">
    <input type="checkbox" checked class="w-5 h-5 rounded border-gray-300 text-blue-600 focus:ring-blue-500" />
    <span class="text-sm text-gray-700">Subscribe to newsletter</span>
  </label>
  <label class="flex items-center gap-3 cursor-pointer">
    <input type="checkbox" disabled class="w-5 h-5 rounded border-gray-300 text-gray-400" />
    <span class="text-sm text-gray-400">Disabled checkbox</span>
  </label>
</div>

<!-- Checkbox - Custom Styled -->
<div class="mt-6 space-y-3">
  <label class="flex items-center gap-3 cursor-pointer group">
    <div class="w-6 h-6 rounded-md border-2 border-gray-300 bg-white flex items-center justify-center transition-colors group-hover:border-blue-400">
      <input type="checkbox" class="sr-only" />
      <svg class="w-4 h-4 text-white hidden" fill="none" stroke="currentColor" viewBox="0 0 24 24">
        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M5 13l4 4L19 7" />
      </svg>
    </div>
    <span class="text-sm text-gray-700">Custom checkbox (click me)</span>
  </label>
  <label class="flex items-center gap-3 cursor-pointer group">
    <div class="w-6 h-6 rounded-full border-2 border-gray-300 bg-white flex items-center justify-center transition-colors group-hover:border-purple-400 peer-checked:bg-purple-500">
      <input type="checkbox" class="sr-only" checked />
      <svg class="w-3 h-3 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M5 13l4 4L19 7" />
      </svg>
    </div>
    <span class="text-sm text-gray-700">Round checkbox (checked)</span>
  </label>
</div>

<!-- Checkbox - List with Description -->
<div class="mt-6 p-4 bg-gray-50 rounded-xl space-y-4">
  <label class="flex items-start gap-3 cursor-pointer">
    <input type="checkbox" checked class="w-5 h-5 mt-0.5 rounded border-gray-300 text-blue-600 focus:ring-blue-500" />
    <div>
      <span class="text-sm font-medium text-gray-900">Marketing emails</span>
      <p class="text-xs text-gray-500 mt-0.5">Receive updates about products and features</p>
    </div>
  </label>
  <label class="flex items-start gap-3 cursor-pointer">
    <input type="checkbox" class="w-5 h-5 mt-0.5 rounded border-gray-300 text-blue-600 focus:ring-blue-500" />
    <div>
      <span class="text-sm font-medium text-gray-900">Security alerts</span>
      <p class="text-xs text-gray-500 mt-0.5">Get notified about important security updates</p>
    </div>
  </label>
  <label class="flex items-start gap-3 cursor-pointer">
    <input type="checkbox" checked class="w-5 h-5 mt-0.5 rounded border-gray-300 text-blue-600 focus:ring-blue-500" />
    <div>
      <span class="text-sm font-medium text-gray-900">Weekly digest</span>
      <p class="text-xs text-gray-500 mt-0.5">Summary of your weekly activity</p>
    </div>
  </label>
</div>
62 lines UTF-8 · LF · Spaces: 2

AI-ready

Available to your agent.

This component is reachable through the DevSnips CLI, MCP server and Skills integrations — one registry, one resource path.

Resource path

devsnips://components/input/checkbox-styled

Continue browsing

View all