UNPKG

@cerberus-design/react

Version:

The Cerberus Design React component library.

15 lines (12 loc) 589 B
import { jsxs, jsx } from 'react/jsx-runtime'; import { SwitchParts } from './parts.js'; import { SwitchIndicator } from './switch-indicator.js'; function Switch(props) { const { children, ...rootProps } = props; return /* @__PURE__ */ jsxs(SwitchParts.Root, { ...rootProps, children: [ /* @__PURE__ */ jsx(SwitchParts.Control, { children: /* @__PURE__ */ jsx(SwitchParts.Thumb, { children: /* @__PURE__ */ jsx(SwitchIndicator, {}) }) }), /* @__PURE__ */ jsx(SwitchParts.Label, { children }), /* @__PURE__ */ jsx(SwitchParts.HiddenInput, {}) ] }); } export { Switch };