Skip to content

About

A Mantine 9 draggable, resizable floating window component with persistent state, customizable controls position/order, optional ScrollArea, WindowGroup compound component, and layout presets.

Topics

Resources

Code of conduct

Contributing

Stars

21 stars

Watchers

2 watching

Forks

Latest commit

 

History

262 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mantine Window Component

Mantine Window

mantine-window at a glance, refreshed daily: commits, releases, stars, issues and pull requests, a year of commit activity, the weekly rhythm, languages, latest commits and releases, contributors
Made with glancecard · refreshed daily

Overview

This component is created on top of the Mantine library. It requires Mantine 9.x and React 19.

Mantine Window is a versatile UI container that brings a familiar desktop‑like window experience to React applications built with Mantine.

Video tutorial

Add a draggable, resizable window | Mantine Extensions Tutorial 04

Add a draggable, resizable window (1:54): install Window, open a floating window on your page, let people drag and resize it within limits, collapse and close it from your own state, and snap it to half the page or fill it. More in the Mantine Extensions Tutorials playlist.

Features

  • Draggable and resizable floating windows with 8-direction resize handles
  • Portal or container-relative positioning (withinPortal)
  • Controlled and uncontrolled position/size with mixed unit support (px, vw/vh, %)
  • Responsive values via Mantine breakpoints for all dimension props
  • Persistent state via localStorage (position, size, collapse state)
  • Configurable drag boundaries to constrain movement
  • axis prop to lock dragging to one direction
  • Touch-friendly: a swipe scrolls overflowing content, each window follows only its own finger, bigger touch targets on coarse pointers
  • keepInBounds: windows move back inside, and shrink to fit, when a phone rotates or the viewport or container shrinks
  • Keyboard resizing on one focusable WAI-ARIA separator handle: arrow keys, Shift for a bigger step, Home / End to the min / max size
  • Min/max size constraints with multi-unit support
  • Collapsible content with double-click header toggle
  • Z-index management with bring-to-front on interaction
  • Window.Group compound component for coordinated multi-window management
  • Layout presets: snap, tile, columns, rows, fill
  • Full Mantine Styles API support with fine-grained classNames
  • SSR-safe with hydration-compatible viewport unit resolution
  • onPositionChange and onSizeChange callbacks, plus onDragStart / onDragEnd and onResizeStart / onResizeEnd at the edges of each gesture
  • Headless useDragResize hook: the same drag, resize, units, bounds and keyboard resizing on any element of your own
  • withScrollArea prop to disable the internal ScrollArea wrapper
  • controlsPosition prop for macOS-style (left) or Windows-style (right) button placement
  • controlsOrder prop for custom button ordering (close, collapse, tools)

Installation

npm install @gfazioli/mantine-window

or

yarn add @gfazioli/mantine-window

After installation import package styles at the root of your application:

import '@gfazioli/mantine-window/styles.css';

Usage

import { Window } from '@gfazioli/mantine-window';
import { Title } from '@mantine/core';

function Demo() {
  return (
    <Window title="Hello World" opened defaultX={50} defaultY={50} defaultWidth={400} defaultHeight={300}>
      <Title order={4}>This is a window</Title>
    </Window>
  );
}

Sponsor

Your support helps me:

  • Keep the project actively maintained with timely bug fixes and security updates
  • Add new features, improve performance, and refine the developer experience
  • Expand test coverage and documentation for smoother adoption
  • Ensure long‑term sustainability without relying on ad hoc free time
  • Prioritize community requests and roadmap items that matter most

Open source thrives when those who benefit can give back—even a small monthly contribution makes a real difference. Sponsorships help cover maintenance time, infrastructure, and the countless invisible tasks that keep a project healthy.

Your help truly matters.

💚 Become a sponsor today and help me keep this project reliable, up‑to‑date, and growing for everyone.


studio.mp4

About

A Mantine 9 draggable, resizable floating window component with persistent state, customizable controls position/order, optional ScrollArea, WindowGroup compound component, and layout presets.

Topics

Resources

Code of conduct

Contributing

Stars

21 stars

Watchers

2 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages