toggle styled but no functionality
This commit is contained in:
16
src/components/subComponents/Toggle.jsx
Normal file
16
src/components/subComponents/Toggle.jsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import React, { useState } from "react";
|
||||
import "../../css/Toggle.css";
|
||||
|
||||
const Toggle = () => {
|
||||
const [toggled, setToggled] = useState(false);
|
||||
return (
|
||||
<button
|
||||
className={`toggle-btn ${toggled ? "toggled" : ""}`}
|
||||
onClick={() => setToggled(!toggled)}
|
||||
>
|
||||
<div className="thumb"></div>
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
||||
export default Toggle;
|
||||
Reference in New Issue
Block a user