Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zzarcon/react-cristal

Beautiful window manager for React
https://github.com/zzarcon/react-cristal

Last synced: 3 months ago
JSON representation

Beautiful window manager for React

Awesome Lists containing this project

README

        

# react-cristal
> Convert any component into a window


demo



# Demo 🍿

[https://zzarcon.github.io/react-cristal](https://zzarcon.github.io/react-cristal)

# Features ✨

* Draggable
* Resizable
* Automatically stacking
* Smart positions
* Window boundaries restriction

# Install 🚀

```
$ yarn add react-cristal
```

# Usage ⛏

**Basic**

```tsx
import Cristal from 'react-cristal';

Look at me, I'm inside a window!

```

**Custom**

```tsx
import Cristal from 'react-cristal';

console.log('close clicked')}
>


Some content

```

# Using initial position

```tsx
// Smart positions

// Custom coordinates

```

# Api 📚

```ts
export type InitialPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'center';

interface Props {
children: ReactNode;
title?: string;
initialPosition?: InitialPosition;
isResizable?: boolean;
onClose?: () => void;
className?: string;
}
```

See [example/](https://github.com/zzarcon/react-cristal/tree/master/example) for full example.

# Author

[@zzarcon](https://twitter.com/zzarcon)