UNPKG

@mankindui/core

Version:

- a react component library - you can see how @mankindui/core can be used via examples: [usage examples](https://github.com/clarklindev/mankindui-test)

50 lines (49 loc) 1.12 kB
import { j as t } from "../../_virtual/jsx-runtime.js"; import l from "react"; const o = l.memo(({ onChange: r, savedData: e }) => /* @__PURE__ */ t.jsxs( "label", { "data-component": o.displayName, className: [ `relative inline-block w-[50px] h-[26px]`, e ? "bg-blue-500" : "bg-red-300", `rounded-full group flex items-center cursor-pointer ` ].join(" "), children: [ /* @__PURE__ */ t.jsx( "div", { className: [ ` absolute block w-[20px] h-[20px] bg-white rounded-full transition-transform duration-200 transform `, "translate-y-[3px]", e ? "translate-x-[27px]" : "translate-x-[3px]" ].join(" ") } ), /* @__PURE__ */ t.jsx("input", { className: "hidden", type: "checkbox", checked: e, onChange: r }) ] } )); o.displayName = "ToggleSwitch"; export { o as ToggleSwitch }; //# sourceMappingURL=index.js.map