studiobakers / react-ui-toolkit

Bakers Studio's React-based UI Toolkit
MIT License
15 stars 2 forks source link

CheckboxInput: Allow custom icon #149

Closed Anlerkan closed 2 years ago

Anlerkan commented 3 years ago

I think we should be able to customize the checkbox input icon

export interface CheckboxInputProps {
  item: RadioInputItem;
  onSelect: (
    item: RadioInputItem,
    event?: React.SyntheticEvent<HTMLInputElement>
  ) => void;
  isSelected: boolean;
  isDisabled?: boolean;
+ customIcon?: React.ReactNode;
  customClassName?: string;
  testid?: string;
}

const icon = customIcon || <CheckIcon />;

<span className={"checkbox-input-label__icon"}>{icon}</span>