RichTextEditor
RichTextEditor
A rich text editor component which uses ProseMirror (rich text editor) under the hood.
Example
import { RichTextEditor } from '@vendure/admin-ui/react';
import React from 'react';
export function MyComponent() {
const onSubmit = async (e: React.FormEvent) => {
e.preventDefault();
const form = new FormData(e.target as HTMLFormElement);
const content = form.get("content");
console.log(content);
};
return (
<form className="w-full" onSubmit={onSubmit}>
<RichTextEditor
name="content"
readOnly={false}
onMount={(e) => console.log("Mounted", e)}
/>
<button type="submit" className="btn btn-primary">
Submit
</button>
</form>
);
}