
package.dist.components.slider.slider-thumb.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 } from 'react';
import { createSplitProps } from '../../utils/create-split-props.js';
import { ark } from '../factory.js';
import { useSliderContext } from './use-slider-context.js';
import { SliderThumbPropsProvider } from './use-slider-thumb-props-context.js';
const SliderThumb = forwardRef((props, ref) => {
const [thumbProps, localProps] = createSplitProps()(props, ["index", "name"]);
const slider = useSliderContext();
const mergedProps = mergeProps(slider.getThumbProps(thumbProps), localProps);
return /* @__PURE__ */ jsx(SliderThumbPropsProvider, { value: thumbProps, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) });
});
SliderThumb.displayName = "SliderThumb";
export { SliderThumb };
© 2015 - 2025 Weber Informatics LLC | Privacy Policy