
Product
A Fresh Look for the Socket Dashboard
Weβve redesigned the Socket dashboard with simpler navigation, less visual clutter, and a cleaner UI that highlights what really matters.
reactjs-editor
Advanced tools
A simple react library that lets you highlight text, make text bold, and add comment on any text as a sticky notes
$ npm i reactjs-editor
----------------------------- FIRST STEP: -------------------------------
1. Go to your project
$ cd <your typescript project root>
2. Create a new [FILE_NAME].d.ts file
$ touch reacteditor.d.ts
3. Make change to that file by adding the line below
$ nano reacteditor.d.ts
## Add this line below and save ππ
declare module 'reactjs-editor'; //add this line and save
4. Save that file
----------------------------- SECOND STEP: -------------------------------
1. Now open tsconfig.json file, you can find it in root of react typescript project πππ
2. Make change to tsconfig.json file by including path to [FILENAME].d.ts file
$ nano tsconfig.json
## And just include path to file you created above βββ
"include": [
"src",
"./reacteditor.d.ts" //Add this line and save
...
]
$ import { Editor } from 'reactjs-editor';
<Editor
htmlContent={`<main>
<h1>Welcome to My Website</h1>
<p>This is a paragraph of text in HTML. It's simple and easy to create.</p>
<p>HTML stands for HyperText Markup Language. It's the standard markup language for creating web pages.</p>
<p>In HTML, you can create different types of elements such as headings, paragraphs, links, lists, and more to structure and format your content.</p>
</main>`}
/>
htmlContent={
<main>
{ *** all your html content here *** }
</main>
}
<Editor
colors={["black","gold","red"]}
....
/>
/* In your css file */
.black{
background-color:#000,
color:#fff,
},
.red{
background-color:red,
color:#fff,
}
.gold{
background-color:gold,
color:#fff,
}
//add as much as you like
import { Editor, useDomValue } from 'reactjs-editor';
...
const { dom, setDom } = useDomValue();
// eslint-disable-next-line react-hooks/exhaustive-deps
const updatedDomValue = {
key: dom?.key,
props: dom?.props,
ref: dom?.ref,
type: dom?.type,
}
console.log("%j", updatedDomValue );
// get your changed dom like this and save it if you like to in your database or some place
useEffect(()=>{
function updateDom(updatedDomValue:any){
setDom(updatedDomValue); //set your dom like this
}
updateDom(updatedDomValue) // call this function where ever you like
},[])
1. Inspect html element
2. Find className of specific elements
3. Override css present there from your own css files
In future update, I will create option to pass all components in a props
MIT
vivekneupane11@gmail.com Β Β·Β GitHub @vivekneupane11 Β Β·Β
FAQs
A simple react library that lets you highlight text, make text bold, and add comment on any text as a sticky notes
The npm package reactjs-editor receives a total of 31 weekly downloads. As such, reactjs-editor popularity was classified as not popular.
We found that reactjs-editor 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.
Product
Weβve redesigned the Socket dashboard with simpler navigation, less visual clutter, and a cleaner UI that highlights what really matters.
Industry Insights
Terry OβDaniel, Head of Security at Amplitude, shares insights on building high-impact security teams, aligning with engineering, and why AI gives defenders a fighting chance.
Security News
MCP spec updated with structured tool output, stronger OAuth 2.1 security, resource indicators, and protocol cleanups for safer, more reliable AI workflows.