@base-ui/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.
29 lines (27 loc) • 910 B
JavaScript
'use client';
import * as React from 'react';
import { useDialogRootContext } from "../../dialog/root/DialogRootContext.js";
import { useRenderElement } from "../../internals/useRenderElement.js";
import { DRAWER_CONTENT_ATTRIBUTE } from "./DrawerContentDataAttributes.js";
/**
* A container for the drawer contents.
* Renders a `<div>` element.
*
* Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
*/
export const DrawerContent = /*#__PURE__*/React.forwardRef(function DrawerContent(componentProps, forwardedRef) {
const {
render,
className,
style,
...elementProps
} = componentProps;
useDialogRootContext();
return useRenderElement('div', componentProps, {
ref: forwardedRef,
props: [{
[DRAWER_CONTENT_ATTRIBUTE]: ''
}, elementProps]
});
});
if (process.env.NODE_ENV !== "production") DrawerContent.displayName = "DrawerContent";