Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
textcrafter
Advanced tools
TextCrafter: A modern, customizable rich text editor for React. Supports rich formatting, media embedding and real-time collaboration. Ideal for content creators.
A flexible and customizable text editor built for React, supporting both rich text formatting and HTML elements like tables, lists, links, and images. Ideal for use in React and Next.js (App and Page) applications. Compatible with both JavaScript and TypeScript projects. Easily installable via npm or Yarn.
npm install textcrafter
yarn add textcrafter
Style
of the Editor and Toolbar in your App component.import 'textcrafter/dist/styles.min.css';
Editor
component in your React component.import React, { useState } from 'react';
import { Editor } from 'textcrafter';
const MyEditor = () => {
const [editorContent, setEditorContent] = useState('<p>Start editing...</p>');
const handleEditorChange = (content: string) => {
setEditorContent(content);
};
return (
<div>
<Editor value={editorContent} onChange={handleEditorChange} />
</div>
);
};
export default MyEditor;
If you're using Next.js, the editor can be used both in the App and Page directories.
For App (with React Server Components in Next 13+):
Style
of the Editor and Toolbar in your RootLayout.import 'textcrafter/dist/styles.min.css';
Editor
component in your page componentimport React, { useState } from 'react';
import { Editor } from 'textcrafter';
const PageComponent = () => {
const [editorContent, setEditorContent] = useState('<p>Edit here...</p>');
const handleEditorChange = (content: string) => {
setEditorContent(content);
};
return (
<div>
<Editor value={editorContent} onChange={handleEditorChange} />
</div>
);
};
export default PageComponent;
For Page (traditional routing in Next.js):
Style
of the Editor and Toolbar in your _app component.import 'textcrafter/dist/styles.min.css';
Editor
component in your page component// pages/index.tsx or pages/somepage.tsx
import React, { useState } from 'react';
import { Editor } from 'textcrafter';
const HomePage = () => {
const [editorContent, setEditorContent] = useState('<p>Edit here...</p>');
const handleEditorChange = (content: string) => {
setEditorContent(content);
};
return (
<div>
<Editor value={editorContent} onChange={handleEditorChange} />
</div>
);
};
export default HomePage;
The toolbar offers a range of options that can be customized for your use case.
You can customize the editor's appearance by modifying the included CSS styles or by adding your own custom styles.
Contributions are welcome! Please fork the repository, make your changes, and submit a pull request.
This package is licensed under the MIT License.
[1.0.0-beta.1] - 2024-11-11
FAQs
TextCrafter: A modern, customizable rich text editor for React. Supports rich formatting, media embedding and real-time collaboration. Ideal for content creators.
The npm package textcrafter receives a total of 11 weekly downloads. As such, textcrafter popularity was classified as not popular.
We found that textcrafter demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.