Editor.Html
A WYSIWYG HTML editor component.
import { useState } from 'react';import { Editor } from '@fintech-sandpit/ui/react';
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} />);<script setup lang="ts">import { ref } from 'vue';import { Editor } from '@fintech-sandpit/ui/vue';
const value = ref('<h3>Lorem ipsum</h3>\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>');</script>
<template> <Editor.Html v-model="value" /></template>| Name | Type | Default | Description |
|---|---|---|---|
value | string | — | The HTML content (controlled) |
disabled | boolean | false | Whether the editor is disabled |
| Name | Type | Default | Description |
|---|---|---|---|
model-value | string | — | The HTML content (controlled) 1 |
disabled | boolean | false | Whether the editor is disabled |
- Can be used with the
v-modeldirective for two-way binding.
Events
Section titled “Events”| Name | Type | Description |
|---|---|---|
onChange | (value: string) => void | Callback fired when the HTML content changes |
| Name | Payload | Description |
|---|---|---|
update:model-value | string | Event emitted when the HTML content changes |