New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@typeblox/react

Package Overview
Dependencies
Maintainers
0
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@typeblox/react

Simple React block-based WYSIWYG editor

  • 0.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
101
decreased by-75.12%
Maintainers
0
Weekly downloads
 
Created
Source

Typeblox Editor

Simple React block-based WYSIWYG editor

Usage

To use the <EditorProvider /> component, simply import it and configure its properties. Below is an example:

import { EditorProvider } from "./utils/EditorContext";

const sampleContent = `
<h1>Welcome to Typeblox Editor</h1>
<p><strong>Start creating</strong> amazing content with this simple WYSIWYG editor!</p>
<ul>
    <li>Use <strong>bold</strong>, <em>italic</em>, and <u>underline</u> text formatting.</li>
    <li>Change text color and background color.</li>
    <li>Create lists, headings, and more!</li>
</ul>
`;

const onChangeHandler = (updatedHTMLString: string) => {
  // Your code to store the update HTML content;
};

<EditorProvider
  init={{
    toolbars={{
      text: 'bold italic underline strikethrough | font | color bgColor | newModule',
      image: 'replaceImage | alignLeft alignCenter alignRight'
    }}
    slotBefore={<MenuBar style={{marginBottom: '40px'}} />}
    content={sampleContent}
    onChange={onChangeHandler}
    extensions={[
      {
        name: "newModule",
        onClick: () => {
          window.typebloxEditor?.blox().getCurrentBlock()?.toggleStyle('text-align', 'left');
        },
        isActive: () => window.typebloxEditor?.style().getStyle().textAlign === "left",
        iconName: "alignLeft", // Icons from https://tabler.io/
      }]}
  }}
  content={sampleContent}
></EditorProvider>;

License

This package is licensed under Apache License 2.0 + Commons Clause. See the License file.

Keywords

FAQs

Package last updated on 04 Feb 2025

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc