Skip to content

Commit

Permalink
feat: チェックボックスコンポーネント作成(#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
h-yoshikawa44 committed Dec 4, 2021
1 parent f618deb commit 7b383b1
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/components/common/CheckBox/CheckBox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { VFC } from 'react';
import { css } from '@emotion/react';

type Props = {
label: string;
};

const CheckBox: VFC<Props> = ({ label }) => {
return (
<label css={checkBoxControl}>
<input css={checkBox} type="checkbox" />
<span css={labelText}>{label}</span>
</label>
);
};

const checkBoxControl = css`
display: flex;
align-items: center;
`;

const checkBox = css`
width: 24px;
height: 24px;
`;

const labelText = css`
margin-left: 8px;
font-size: 24px;
`;

export default CheckBox;
3 changes: 3 additions & 0 deletions src/components/common/CheckBox/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import CheckBox from '@/components/common/CheckBox/CheckBox';

export { CheckBox };

0 comments on commit 7b383b1

Please sign in to comment.