This commit is contained in:
Jake Archibald
2018-10-16 15:17:42 +01:00
parent 0cec90c7ca
commit ae904cd07f
8 changed files with 131 additions and 299 deletions

View File

@@ -0,0 +1,20 @@
import { h, Component } from 'preact';
import * as style from './style.scss';
import { UncheckedIcon, CheckedIcon } from '../../../lib/icons';
interface Props extends JSX.HTMLAttributes {}
interface State {}
export default class Checkbox extends Component<Props, State> {
render(props: Props) {
return (
<div class={style.checkbox}>
{props.checked
? <CheckedIcon class={`${style.icon} ${style.checked}`} />
: <UncheckedIcon class={style.icon} />
}
<input class={style.realCheckbox} type="checkbox" {...props}/>
</div>
);
}
}