import { HTMLAttributes, forwardRef } from 'react'; import cc from 'classcat'; import type { PanelPosition } from '@xyflow/system'; /** * @expand */ export type PanelProps = HTMLAttributes & { /** * The position of the panel. * @default "top-left" */ position?: PanelPosition; }; /** * The `` component helps you position content above the viewport. * It is used internally by the [``](/api-reference/components/minimap) * and [``](/api-reference/components/controls) components. * * @public * * @example * ```jsx *import { ReactFlow, Background, Panel } from '@xyflow/react'; * *export default function Flow() { * return ( * * top-left * top-center * top-right * bottom-left * bottom-center * bottom-right * * ); *} *``` */ export const Panel = forwardRef( ({ position = 'top-left', children, className, style, ...rest }, ref) => { const positionClasses = `${position}`.split('-'); return (
{children}
); } ); Panel.displayName = 'Panel';