
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
codecrush-react
Advanced tools
An wrapper for codecrush-core (javascript/typescript) editor to use in react
An wrapper for codecrush-core (javascript/typescript) editor to use in react
Choose your favorite package manager
pnpm install codecrush-core codecrush-react
npm install codecrush-core codecrush-react
yarn add codecrush-core codecrush-react
import { Editor } from "codecrush-react";
import "codecrush-core/dist/index.css"; // styles from the core package
function App() {
return (
<div className="App">
<Editor height={400} id="js-editor" theme="material-darker" />
</div>
);
}
export default App;
List of all themes included
export type EditorThemes =
| "dracula-soft"
| "material-darker"
| "material-default"
| "material-ocean"
| "material-palenight"
| "nord"
| "one-dark-pro"
| "poimandres"
| "rose-pine-moon"
| "rose-pine"
| "slack-dark";
You can create custom components for the editor. The following example we create a component to register in the activity bar which key is pressed.
In this case we'll be using onReady
and onKeyPressed
events provided by the editor.
import { Editor } from "codecrush-react";
import "codecrush-core/dist/index.css"; // styles from the core package
import { Component, ActivityBarComponent } from "codecrush-core";
class Example extends Component {
onReady() {
const activityBar =
this.editor.getComponent<ActivityBarComponent>("activity-bar"); // get the activity bar
activityBar.registerActivity("key-pressed", "Keyboard: "); // register a new entry with id and text
}
onKeyPressed(key: string) {
const activityBar =
this.editor.getComponent <ActivityBarComponent>("activity-bar");
activityBar.updateActivity("key-pressed", "Keyboard: " + key); //update the activity when the key is pressed
}
}
function App() {
return (
<div className="App">
<Editor
height={400}
id="js-editor"
theme="material-darker"
components={[Example]}
/>
</div>
);
}
export default App;
FAQs
An wrapper for codecrush-core (javascript/typescript) editor to use in react
We found that codecrush-react demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.