{"id":13626529,"url":"https://github.com/zzarcon/react-cristal","last_synced_at":"2025-04-09T22:22:19.907Z","repository":{"id":68435666,"uuid":"112731028","full_name":"zzarcon/react-cristal","owner":"zzarcon","description":"Beautiful window manager for React","archived":false,"fork":false,"pushed_at":"2019-02-19T00:25:51.000Z","size":7739,"stargazers_count":29,"open_issues_count":14,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-24T00:15:50.365Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://zzarcon.github.io/react-cristal/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zzarcon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-12-01T11:09:39.000Z","updated_at":"2025-02-11T15:49:57.000Z","dependencies_parsed_at":"2023-02-21T09:31:03.959Z","dependency_job_id":null,"html_url":"https://github.com/zzarcon/react-cristal","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzarcon%2Freact-cristal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzarcon%2Freact-cristal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzarcon%2Freact-cristal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzarcon%2Freact-cristal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zzarcon","download_url":"https://codeload.github.com/zzarcon/react-cristal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248120478,"owners_count":21050950,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T21:02:21.861Z","updated_at":"2025-04-09T22:22:19.883Z","avatar_url":"https://github.com/zzarcon.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# react-cristal\n\u003e Convert any component into a window\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"demo.gif\" alt=\"demo\"\u003e\n  \u003cbr\u003e\u003cbr\u003e\n\u003c/div\u003e\n\n# Demo 🍿\n\n[https://zzarcon.github.io/react-cristal](https://zzarcon.github.io/react-cristal)\n\n# Features ✨\n\n* Draggable\n* Resizable\n* Automatically stacking\n* Smart positions\n* Window boundaries restriction\n\n# Install 🚀\n\n```\n$ yarn add react-cristal\n```\n\n# Usage ⛏\n\n**Basic** \n\n```tsx\nimport Cristal from 'react-cristal';\n\n\u003cCristal\u003e\n  Look at me, I'm inside a window!\n\u003c/Cristal\u003e\n```\n\n**Custom**\n\n```tsx\nimport Cristal from 'react-cristal';\n\n\u003cCristal\n  title=\"Some title\"\n  initialPosition=\"top-center\"\n  isResizable={false}\n  onClose={() =\u003e console.log('close clicked')}\n\u003e\n  \u003cdiv\u003e\n    Some content\n  \u003c/div\u003e\n\u003c/Cristal\u003e\n```\n\n# Using initial position\n\n```tsx\n// Smart positions\n\u003cCristal initialPosition=\"center\" /\u003e\n\u003cCristal initialPosition=\"top-right\" /\u003e\n\u003cCristal initialPosition=\"bottom-center\" /\u003e\n\n// Custom coordinates\n\u003cCristal initialPosition={{x: 500, y: 100}} /\u003e\n```\n\n# Api 📚\n\n```ts\nexport type InitialPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'center';\n\ninterface Props {\n  children: ReactNode;\n  title?: string;\n  initialPosition?: InitialPosition;\n  isResizable?: boolean;\n  onClose?: () =\u003e void;\n  className?: string;\n}\n```\n\nSee [example/](https://github.com/zzarcon/react-cristal/tree/master/example) for full example.\n\n# Author\n\n[@zzarcon](https://twitter.com/zzarcon)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzzarcon%2Freact-cristal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzzarcon%2Freact-cristal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzzarcon%2Freact-cristal/lists"}