Skip to content

Commit

Permalink
(#0) Checkbox className 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
baegofda committed Dec 2, 2023
1 parent 60a913f commit d2787b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/components/Checkbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const Checkbox = forwardRef((
label,
svgSize = SVG_SIZE["SIZE_24"],
isCircle = false,
className,
...props
}: CheckboxProps,
ref: React.ComponentPropsWithRef<"input">["ref"],
) => {
Expand All @@ -22,8 +24,8 @@ const Checkbox = forwardRef((
const svg = !isCircle ? RectangleCheckbox : CircleCheckbox;

return (
<label htmlFor = {id} className = {clsx("cursor-pointer", label && "flex items-center gap-2.5")}>
<input ref = {ref} id = {id} type = "checkbox" className = "peer sr-only"/>
<label htmlFor = {id} className = {clsx("cursor-pointer", label && "flex items-center gap-2.5", className)}>
<input ref = {ref} id = {id} type = "checkbox" className = "peer sr-only" {...props}/>
<div className = {`${CHECKBOX_SVG_SIZE[svgSize]} peer-checked:[&>svg>path]:fill-primary-03`}>
{svg}
</div>
Expand Down

0 comments on commit d2787b3

Please sign in to comment.