All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.components.checkbox.checkbox-group.js Maven / Gradle / Ivy

Go to download

A collection of unstyled, accessible UI components for React, utilizing state machines for seamless interaction.

The newest version!
'use client';
import { jsx } from 'react/jsx-runtime';
import { forwardRef } from 'react';
import { createSplitProps } from '../../utils/create-split-props.js';
import { ark } from '../factory.js';
import { checkboxAnatomy } from './checkbox.anatomy.js';
import { useCheckboxGroup } from './use-checkbox-group.js';
import { CheckboxGroupContextProvider } from './use-checkbox-group-context.js';

const CheckboxGroup = forwardRef((props, ref) => {
  const [checkboxGroupProps, localProps] = createSplitProps()(props, [
    "defaultValue",
    "value",
    "onValueChange",
    "disabled",
    "invalid",
    "readOnly",
    "name"
  ]);
  const checkboxGroup = useCheckboxGroup(checkboxGroupProps);
  return /* @__PURE__ */ jsx(CheckboxGroupContextProvider, { value: checkboxGroup, children: /* @__PURE__ */ jsx(ark.div, { ref, role: "group", ...localProps, ...checkboxAnatomy.build().group.attrs }) });
});
CheckboxGroup.displayName = "CheckboxGroup";

export { CheckboxGroup };




© 2015 - 2025 Weber Informatics LLC | Privacy Policy