/uxe-challenge-checkbox-react

Checkbox challenge for UXE Telegram channel in React

Primary LanguageJavaScript

UXE Checkbox Challenge React Component

checkbox animation

API

Prop Type Description
isChecked Boolean Value of the checkbox
onChange Function Change handler function. It's useful for changing the state of checkbox

Example

import React, { useState } from "react";
import "./App.css";

import Checkbox from "./Checkbox";

function App() {
  const [isChecked, setChecked] = useState(false);
  const toggleCheck = () => {
    setChecked(!isChecked);
  }
  return (
    <Checkbox
      isChecked={isChecked}
      onChange={toggleCheck}
    />
  );
}

export default App;

Codepen

Here's demo on CodePen!