
Security News
Rust RFC Proposes a Security Tab on crates.io for RustSec Advisories
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.
ra-input-rich-text
Advanced tools
<RichTextInput> component for react-admin, useful for editing HTML code in admin GUIs.
A rich text editor for React Admin, based on TipTap.
npm install ra-input-rich-text
# or
yarn add ra-input-rich-text
Use it as you would any react-admin input:
import { Edit, SimpleForm, TextInput } from 'react-admin';
import { RichTextInput } from 'ra-input-rich-text';
export const PostEdit = () => (
<Edit>
<SimpleForm>
<TextInput source="title" />
<RichTextInput source="body" />
</SimpleForm>
</Edit>
);
The <RichTextInput> component has a toolbar prop that accepts a ReactNode.
You can leverage this to change the buttons size:
import { Edit, SimpleForm, TextInput } from 'react-admin';
import { RichTextInput, RichTextInputToolbar } from 'ra-input-rich-text';
export const PostEdit = () => (
<Edit>
<SimpleForm>
<TextInput source="title" />
<RichTextInput source="body" toolbar={<RichTextInputToolbar size="large" />} />
</SimpleForm>
</Edit>
);
Or to remove some prebuilt components like the <AlignmentButtons>:
import {
RichTextInput,
RichTextInputToolbar,
LevelSelect,
FormatButtons,
ListButtons,
LinkButtons,
QuoteButtons,
ClearButtons,
} from 'ra-input-rich-text';
const MyRichTextInput = ({ size, ...props }) => (
<RichTextInput
toolbar={
<RichTextInputToolbar>
<LevelSelect size={size} />
<FormatButtons size={size} />
<ListButtons size={size} />
<LinkButtons size={size} />
<QuoteButtons size={size} />
<ClearButtons size={size} />
</RichTextInputToolbar>
}
label="Body"
source="body"
{...props}
/>
);
You might want to add more TipTap extensions. The <RichTextInput> component accepts an editorOptions prop, which is the object passed to the TipTap Editor.
If you just want to add extensions, don't forget to include those needed by default for our implementation. Here's an example to add the HorizontalRule node:
import {
DefaultEditorOptions,
RichTextInput,
RichTextInputToolbar,
LevelSelect,
FormatButtons,
AlignmentButtons,
ListButtons,
LinkButtons,
QuoteButtons,
ClearButtons,
} from 'ra-input-rich-text';
import HorizontalRule from '@tiptap/extension-horizontal-rule';
import Remove from '@mui/icons-material/Remove';
const MyRichTextInput = ({ size, ...props }) => (
<RichTextInput
editorOptions={MyEditorOptions}
toolbar={
<RichTextInputToolbar>
<LevelSelect size={size} />
<FormatButtons size={size} />
<AlignmentButtons {size} />
<ListButtons size={size} />
<LinkButtons size={size} />
<QuoteButtons size={size} />
<ClearButtons size={size} />
<ToggleButton
aria-label="Add an horizontal rule"
title="Add an horizontal rule"
onClick={() => editor.chain().focus().setHorizontalRule().run()}
selected={editor && editor.isActive('horizontalRule')}
>
<Remove fontSize="inherit" />
</ToggleButton>
</RichTextInputToolbar>
}
label="Body"
source="body"
{...props}
/>
);
export const MyEditorOptions = {
...DefaultEditorOptions,
extensions: [
...DefaultEditorOptions.extensions,
HorizontalRule,
],
};
This data provider is licensed under the MIT License, and sponsored by Marmelab.
FAQs
<RichTextInput> component for react-admin, useful for editing HTML code in admin GUIs.
The npm package ra-input-rich-text receives a total of 14,053 weekly downloads. As such, ra-input-rich-text popularity was classified as popular.
We found that ra-input-rich-text demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.

Security News
/Research
Socket found a Rust typosquat (finch-rust) that loads sha-rust to steal credentials, using impersonation and an unpinned dependency to auto-deliver updates.

Research
/Security Fundamentals
A pair of typosquatted Go packages posing as Google’s UUID library quietly turn helper functions into encrypted exfiltration channels to a paste site, putting developer and CI data at risk.