View as Markdown

API reference: @salmonui/rich-text

RichTextContentPropsinterface

import type { RichTextContentProps } from '@salmonui/rich-text';
interface RichTextContentProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'dangerouslySetInnerHTML'> {
    value?: string;
    blocks?: readonly Block[];
    embedHosts?: readonly string[];
    sanitize?: SanitizeHook;
    className?: string;
    style?: CSSProperties;
    ref?: Ref<HTMLDivElement>;
}
RichTextContentProps members (7)
NameSignatureDescription
valueoptionalvalue?: string;

Stored HTML (for example a RichTextEditor value). Sanitized before rendering.

blocksoptionalblocks?: readonly Block[];

BlockEditor blocks; rendered through blocksToHtml when value is not given.

embedHostsoptionalembedHosts?: readonly string[];

Hostnames whose iframe embeds are kept (see SanitizeHtmlOptions.embedHosts).

sanitizeoptionalsanitize?: SanitizeHook;

Further sanitizer restriction (see SanitizeHook); keep it stable (module scope or memoized).

classNameoptionalclassName?: string;
styleoptionalstyle?: CSSProperties;
refoptionalref?: Ref<HTMLDivElement>;