{"id":16800017,"url":"https://github.com/alxnddr/solid-monaco","last_synced_at":"2025-09-10T02:40:28.427Z","repository":{"id":196385684,"uuid":"692810708","full_name":"alxnddr/solid-monaco","owner":"alxnddr","description":"Monaco Editor component for SolidJS","archived":false,"fork":false,"pushed_at":"2024-09-01T20:44:35.000Z","size":166,"stargazers_count":58,"open_issues_count":5,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-19T05:23:26.346Z","etag":null,"topics":["monaco","monaco-editor","solidjs"],"latest_commit_sha":null,"homepage":"","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/alxnddr.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-17T16:47:16.000Z","updated_at":"2025-08-13T17:45:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"58ccf710-de3e-47f7-a7b9-0cda0aaddfbe","html_url":"https://github.com/alxnddr/solid-monaco","commit_stats":null,"previous_names":["alxnddr/solid-monaco"],"tags_count":2,"template":false,"template_full_name":"solidjs-community/solid-lib-starter","purl":"pkg:github/alxnddr/solid-monaco","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxnddr%2Fsolid-monaco","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxnddr%2Fsolid-monaco/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxnddr%2Fsolid-monaco/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxnddr%2Fsolid-monaco/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alxnddr","download_url":"https://codeload.github.com/alxnddr/solid-monaco/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxnddr%2Fsolid-monaco/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274402379,"owners_count":25278341,"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","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["monaco","monaco-editor","solidjs"],"created_at":"2024-10-13T09:30:31.320Z","updated_at":"2025-09-10T02:40:28.385Z","avatar_url":"https://github.com/alxnddr.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp\u003e\n  \u003cimg width=\"100%\" src=\"https://assets.solidjs.com/banner?type=solid-monaco\u0026background=tiles\u0026project=%20\" alt=\"solid-monaco\"\u003e\n\u003c/p\u003e\n\n# solid-monaco\n\n[![pnpm](https://img.shields.io/badge/maintained%20with-pnpm-cc00ff.svg?style=for-the-badge\u0026logo=pnpm)](https://pnpm.io/)\n\nMonaco Editor for SolidJS\n\n## Quick start\n\nInstall it:\n\n```bash\nnpm i solid-monaco\n```\n*or*\n\n```bash\nyarn add solid-monaco\n```\n*or*\n```bash\npnpm add solid-monaco\n```\n\n## MonacoEditor\n\nBasic usage:\n\nYou can import and use the `MonacoEditor` component in your Solid application:\n\n```jsx\nimport { MonacoEditor } from 'solid-monaco';\n\nfunction MyEditor() {\n  return \u003cMonacoEditor language=\"javascript\" value=\"console.log('Hello World');\" /\u003e;\n}\n```\n\n### Props\n\nThe `MonacoEditor` component accepts the following props:\n\n| Prop               | Type                                                               | Default      | Description                                                                    |\n|--------------------|--------------------------------------------------------------------|--------------|--------------------------------------------------------------------------------|\n| `language`         | `string`                                                           | -            | The programming language for the editor. E.g., `\"javascript\"`, `\"typescript\"`. |\n| `value`            | `string`                                                           | -            | Content of the editor.                                                         |\n| `loadingState`     | `JSX.Element`                                                      | `\"Loading…\"` | JSX element to be displayed during the loading state.                          |\n| `class`            | `string`                                                           | -            | CSS class for the editor container.                                            |\n| `theme`            | `BuiltinTheme` or `string`                                         | `\"vs\"`       | The theme to be applied to the editor.                                         |\n| `path`             | `string`                                                           | `\"\"`         | Path used for Monaco model management for multiple files.                      |\n| `overrideServices` | `object`                                                           | -            | Services to override the default ones provided by Monaco.                      |\n| `width`            | `string`                                                           | `\"100%\"`     | Width of the editor container.                                                 |\n| `height`           | `string`                                                           | `\"100%\"`     | Height of the editor container.                                                |\n| `options`          | `object`                                                           | -            | Additional options for the Monaco editor.                                      |\n| `saveViewState`    | `string`                                                           | `true`       | Whether to save the model view state for a given path of the editor.           |\n| `onChange`         | `(value: string, event: editor.IModelContentChangedEvent) =\u003e void` | -            | Callback triggered when the content of the editor changes.                     |\n| `onMount`          | `(monaco: Monaco, editor: editor.IStandaloneCodeEditor) =\u003e void`   | -            | Callback triggered when the editor mounts.                                     |\n| `onBeforeUnmount`  | `(monaco: Monaco, editor: editor.IStandaloneCodeEditor) =\u003e void`   | -            | Callback triggered before the editor unmounts.                                 |\n\n### Getting Monaco and Editor Instances\n\nYou can get instances of both `monaco` and the `editor` by using the `onMount` callback:\n\n```jsx\nimport { MonacoEditor } from 'solid-monaco';\n\nfunction MyEditor() {\n  const handleMount = (monaco, editor) =\u003e {\n    // Use monaco and editor instances here\n  };\n\n  return (\n    \u003cMonacoEditor\n      language=\"javascript\"\n      value=\"console.log('Hello World');\"\n      onMount={handleMount}\n    /\u003e\n  );\n}\n```\n\n## MonacoDiffEditor\n\nFor a side-by-side comparison view of code, the package provides a `MonacoDiffEditor` component.\n\n### Basic Usage\n\nYou can incorporate the `MonacoDiffEditor` component into your Solid application:\n\n```jsx\nimport { MonacoDiffEditor } from 'solid-monaco';\n\nfunction MyDiffEditor() {\n  return (\n    \u003cMonacoDiffEditor\n      original=\"const foo = 1;\"\n      modified=\"const foo = 2;\"\n      originalLanguage=\"javascript\"\n      modifiedLanguage=\"javascript\"\n    /\u003e\n  );\n}\n```\n\n### Props\n\nThe `MonacoDiffEditor` component accepts the following props:\n\n| Prop               | Type                                                             | Default      | Description                                                            |\n|--------------------|------------------------------------------------------------------|--------------|------------------------------------------------------------------------|\n| `original`         | `string`                                                         | -            | Original content to be displayed on the left side of the diff editor.  |\n| `modified`         | `string`                                                         | -            | Modified content to be displayed on the right side of the diff editor. |\n| `originalLanguage` | `string`                                                         | -            | Language for the original content.                                     |\n| `modifiedLanguage` | `string`                                                         | -            | Language for the modified content.                                     |\n| `originalPath`     | `string`                                                         | -            | Path for the original content used in Monaco model management.         |\n| `modifiedPath`     | `string`                                                         | -            | Path for the modified content used in Monaco model management.         |\n| `loadingState`     | `JSX.Element`                                                    | `\"Loading…\"` | JSX element displayed during the loading state.                        |\n| `class`            | `string`                                                         | -            | CSS class for the diff editor container.                               |\n| `theme`            | `BuiltinTheme` or `string`                                       | `\"vs\"`       | Theme applied to the diff editor.                                      |\n| `overrideServices` | `object`                                                         | -            | Services to override the default ones provided by Monaco.              |\n| `width`            | `string`                                                         | `\"100%\"`     | Width of the diff editor container.                                    |\n| `height`           | `string`                                                         | `\"100%\"`     | Height of the diff editor container.                                   |\n| `options`          | `object`                                                         | -            | Additional options for the Monaco diff editor.                         |\n| `saveViewState`    | `boolean`                                                        | `true`       | Whether to save the model view state.                                  |\n| `onChange`         | `(value: string) =\u003e void`                                        | -            | Callback triggered when the content of the modified editor changes.    |\n| `onMount`          | `(monaco: Monaco, editor: editor.IStandaloneDiffEditor) =\u003e void` | -            | Callback triggered when the diff editor mounts.                        |\n| `onBeforeUnmount`  | `(monaco: Monaco, editor: editor.IStandaloneDiffEditor) =\u003e void` | -            | Callback triggered before the diff editor unmounts.                    |\n\n## Contributing\n\nContributions to `solid-monaco` are welcomed!\n\n## Acknowledgments\n\n- [monaco-editor](https://github.com/microsoft/monaco-editor): The core editor that this package wraps for Solid.js.\n- [monaco-react](https://github.com/suren-atoyan/monaco-react) by [Suren Atoyan](https://github.com/suren-atoyan): A\n  package referred to during the development of the solid-monaco wrapper.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falxnddr%2Fsolid-monaco","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falxnddr%2Fsolid-monaco","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falxnddr%2Fsolid-monaco/lists"}