mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
feat: added readOnly at Toggle
This commit is contained in:
parent
88caef75b0
commit
0767d8d5bc
@ -1,6 +1,6 @@
|
||||
const Toggle = ({ checked, onChange }:ToggleProps):JSX.Element => {
|
||||
return <button className='relative inline-block w-10 mr-2 align-middle select-none outline-none' onClick={onChange} onKeyPress={onChange}>
|
||||
<input type='checkbox' checked={checked} className='absolute block w-6 h-6 rounded-full bg-white border-4 border-transparent appearance-none cursor-pointer outline-none checked:right-0'/>
|
||||
<input type='checkbox' checked={checked} className='absolute block w-6 h-6 rounded-full bg-white border-4 border-transparent appearance-none cursor-pointer outline-none checked:right-0' readOnly />
|
||||
<span className={`block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer ${checked ? 'bg-koreanbots-blue' : ''}`}></span>
|
||||
</button>
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user