Skip to content

Editor.Html

A WYSIWYG HTML editor component.

import { useState } from 'react';
// Import component
import { Editor } from '@fintech-sandpit/ui/react';
// Import styles (optional). Please note that the tooltip styles are also required.
import '@fintech-sandpit/ui/style/components/editor.css';
import '@fintech-sandpit/ui/style/tooltip.css';
const [value, setValue] = useState('<h3>Lorem ipsum</h3>\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>');
return (
<Editor.Html
value={value}
onChange={setValue}
/>
);
NameTypeDefaultDescription
valuestring—The HTML content (controlled)
disabledbooleanfalseWhether the editor is disabled
NameTypeDescription
onChange(value: string) => voidCallback fired when the HTML content changes