Skip to content

Commit 3d280be

Browse files
committed
added CheckboxWithLabel component
1 parent 386fd2e commit 3d280be

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import React from 'react'
2+
3+
const CheckboxWithLabel = (props) => {
4+
const {currentState, onChangeFunc, name, labelText} = props
5+
6+
return (
7+
<div className="text-l tracking-tight text-gray-300 mt-5">
8+
<div>
9+
<input
10+
type="checkbox"
11+
id={name + "Id"}
12+
name={name}
13+
checked={currentState}
14+
onChange={onChangeFunc}
15+
/>
16+
<label htmlFor={name + "Id"} className="font-bold">
17+
<span /> {labelText}
18+
</label>
19+
</div>
20+
</div>
21+
)
22+
}
23+
24+
export default CheckboxWithLabel

0 commit comments

Comments
 (0)