@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.
24 lines (22 loc) • 721 B
JavaScript
'use client';
import * as React from 'react';
import { DirectionContext } from "./DirectionContext.js";
/**
* Enables RTL behavior for Base UI components.
*
* Documentation: [Base UI Direction Provider](https://base-ui.com/react/utils/direction-provider)
*/
import { jsx as _jsx } from "react/jsx-runtime";
export const DirectionProvider = function DirectionProvider(props) {
const {
direction = 'ltr'
} = props;
const contextValue = React.useMemo(() => ({
direction
}), [direction]);
return /*#__PURE__*/_jsx(DirectionContext.Provider, {
value: contextValue,
children: props.children
});
};
if (process.env.NODE_ENV !== "production") DirectionProvider.displayName = "DirectionProvider";