style: Implement custom checkbox styling with a checked state SVG icon.

This commit is contained in:
pradeepkumar
2026-02-01 18:45:31 +05:30
parent 58a1918fa8
commit f48c665b0a
2 changed files with 2 additions and 2 deletions

View File

@@ -38,7 +38,7 @@ function FilterSection({ title, options, selectedOptions, onToggle, showMore }:
type="checkbox"
checked={selectedOptions.includes(option.value)}
onChange={() => onToggle(option.value)}
className="w-4 h-4 rounded border-[#00293d]/30 text-[#e58625] focus:ring-[#e58625]"
className="w-4 h-4 rounded border-2 border-[#00293d]/30 appearance-none cursor-pointer checked:bg-[#e58625] checked:border-[#e58625] checked:bg-[url('data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22white%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.207%204.793a1%201%200%20010%201.414l-5%205a1%201%200%2001-1.414%200l-2-2a1%201%200%20011.414-1.414L6.5%209.086l4.293-4.293a1%201%200%20011.414%200z%22%2F%3E%3C%2Fsvg%3E')] checked:bg-center checked:bg-no-repeat focus:ring-2 focus:ring-[#e58625]/50"
/>
<span className="font-serif text-[13px] text-[#00293d]">{option.label}</span>
</label>

View File

@@ -83,7 +83,7 @@ export function FilterModal({ isOpen, onClose, filters, filterFields, onToggleFi
type="checkbox"
checked={(filters[field.slug] || []).includes(option.value)}
onChange={() => onToggleFilter(field.slug, option.value)}
className="w-[17px] h-[17px] rounded-[5px] border-[#00293d]/20 text-[#e58625] focus:ring-[#e58625]"
className="w-[17px] h-[17px] rounded-[5px] border-2 border-[#00293d]/30 appearance-none cursor-pointer checked:bg-[#e58625] checked:border-[#e58625] checked:bg-[url('data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22white%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.207%204.793a1%201%200%20010%201.414l-5%205a1%201%200%2001-1.414%200l-2-2a1%201%200%20011.414-1.414L6.5%209.086l4.293-4.293a1%201%200%20011.414%200z%22%2F%3E%3C%2Fsvg%3E')] checked:bg-center checked:bg-no-repeat focus:ring-2 focus:ring-[#e58625]/50"
/>
<span className="font-serif text-[15px] text-[#00293d]">{option.label}</span>
</label>