• Custom window titlebar with draggable region and window controls

    Creates a complete titlebar for Electron applications with:

    • A draggable area for moving the window
    • Optional title content in the draggable region
    • Standard window control buttons (minimize, maximize, close)

    Parameters

    • props: DragWindowRegionProps

      Component properties

      Props for the DragWindowRegion component

      • Optionaltitle?: ReactNode

        Optional content to display in the titlebar. Can be text or a React component.

    Returns Element

    React component for window titlebar

    export default function DragWindowRegion({ title }: DragWindowRegionProps) {
    return (
    <div className="flex w-screen items-stretch justify-between">
    <div className="draglayer w-full">
    {title && (
    <div className="flex flex-1 select-none whitespace-nowrap p-2 text-xs text-gray-400">
    {title}
    </div>
    )}
    </div>
    <WindowButtons />
    </div>
    );
    }