Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

174
Views
How to insert text in Toast UI Editor [React] for button click

How to insert the text in editor for the button click on toast ui react editor We have created a separate button in toastui editor tab, In below code we have inserted the text in console for the button click, we want to insert the same in Editor

import React from "react";
import "@toast-ui/editor/dist/toastui-editor.css";
import { Editor } from "@toast-ui/react-editor";

function Editor4() {
  let editorRef = React.createRef();

  //Adding item based on button click
  const handleClick = () => {
    editorRef.current
      .getInstance()
      .addCommand("markdown", "additem", function additem() {
        console.log("ButtonClicked");
      });
  };
  return (
    <div>
      <div>
        <Editor
          initialValue="Hello"
          previewStyle="vertical"
          height="400px"
          initialEditType="markdown"
          ref={editorRef}
          toolbarItems={[
            [
              "heading",
              "bold",
              {
                name: "Button",
                tooltip: "myItem",
                command: "additem",
                className: "toastui-editor-toolbar-icons",
                text: "V",
              }]
          ]}
        />
        <button onClick={handleClick}>makeBold</button>
      </div>
    </div>
  );
}
about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!