Skip to content

Commit 06bd589

Browse files
committed
[#44] ✨ Implement RadioInput component
1 parent d84fc51 commit 06bd589

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import clsx from 'clsx'
2+
import React from 'react'
3+
4+
interface RadioInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
5+
label: string
6+
}
7+
8+
export const RadioInput = ({
9+
label,
10+
className = '',
11+
checked,
12+
disabled,
13+
...props
14+
}: RadioInputProps) => {
15+
return (
16+
<label
17+
className={clsx(
18+
'flex cursor-pointer items-center',
19+
disabled && 'cursor-not-allowed opacity-50',
20+
className
21+
)}
22+
>
23+
<input type='radio' checked={checked} disabled={disabled} {...props} />
24+
<span className='custom-radio'></span>
25+
<span className='text-body-2 ml-4 h-22 font-normal leading-body2 text-gray-800'>
26+
{label}
27+
</span>
28+
</label>
29+
)
30+
}

0 commit comments

Comments
 (0)