@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.
25 lines (24 loc) • 865 B
JavaScript
'use client';
import * as React from 'react';
import { Separator } from "../../separator/index.js";
import { useToolbarRootContext } from "../root/ToolbarRootContext.js";
import { jsx as _jsx } from "react/jsx-runtime";
/**
* A separator element accessible to screen readers.
* Renders a `<div>` element.
*
* Documentation: [Base UI Toolbar](https://base-ui.com/react/components/toolbar)
*/
export const ToolbarSeparator = /*#__PURE__*/React.forwardRef(function ToolbarSeparator(props, forwardedRef) {
const context = useToolbarRootContext();
const orientation = {
vertical: 'horizontal',
horizontal: 'vertical'
}[context.orientation];
return /*#__PURE__*/_jsx(Separator, {
orientation: orientation,
...props,
ref: forwardedRef
});
});
if (process.env.NODE_ENV !== "production") ToolbarSeparator.displayName = "ToolbarSeparator";