
package.dist.components.menu.menu-radio-item-group.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of react Show documentation
Show all versions of react Show documentation
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 { mergeProps } from '@zag-js/react';
import { forwardRef, useId } from 'react';
import { createSplitProps } from '../../utils/create-split-props.js';
import { ark } from '../factory.js';
import { useMenuContext } from './use-menu-context.js';
import { MenuItemGroupProvider } from './use-menu-item-group-context.js';
const MenuRadioItemGroup = forwardRef(
(props, ref) => {
const [optionalItemGroupProps, localProps] = createSplitProps()(props, ["id", "onValueChange", "value"]);
const menu = useMenuContext();
const id = useId();
const itemGroupProps = { id, ...optionalItemGroupProps };
const mergedProps = mergeProps(menu.getItemGroupProps({ id: itemGroupProps.id }), localProps);
return /* @__PURE__ */ jsx(MenuItemGroupProvider, { value: itemGroupProps, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) });
}
);
MenuRadioItemGroup.displayName = "MenuRadioItemGroup";
export { MenuRadioItemGroup };
© 2015 - 2025 Weber Informatics LLC | Privacy Policy