UNPKG

@base-ui-components/react

Version:

Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.

30 lines (29 loc) 975 B
'use client'; import * as React from 'react'; import { useRenderElement } from "../../utils/useRenderElement.js"; import { useProgressRootContext } from "../root/ProgressRootContext.js"; import { progressStateAttributesMapping } from "../root/stateAttributesMapping.js"; /** * Contains the progress bar indicator. * Renders a `<div>` element. * * Documentation: [Base UI Progress](https://base-ui.com/react/components/progress) */ export const ProgressTrack = /*#__PURE__*/React.forwardRef(function ProgressTrack(componentProps, forwardedRef) { const { render, className, ...elementProps } = componentProps; const { state } = useProgressRootContext(); const element = useRenderElement('div', componentProps, { state, ref: forwardedRef, props: elementProps, stateAttributesMapping: progressStateAttributesMapping }); return element; }); if (process.env.NODE_ENV !== "production") ProgressTrack.displayName = "ProgressTrack";