Markdown & Editor
Renderiza markdown con sabor GitHub como texto y edítalo con barra de herramientas, vista previa en directo y vista dividida.
Disponible en
Angular: disponible Vue: disponible React: disponible React Native: aún no disponible
Uso
Planning sync with Ada Park and Leo Ruiz.
Cut the onboarding checklist to five steps
Ship it behind the
short-onboardingflagDraft the invite copy
Legal review by Friday
<div class="demo-stack" style="max-width: 680px; width: 100%">
<div soneField>
<label soneFieldLabel for="markdown-source">Markdown</label>
<textarea
#sourceInput
id="markdown-source"
rows="6"
[value]="note()"
(input)="note.set(sourceInput.value)"
></textarea>
</div>
<sone-markdown data-testid="markdown-reference-preview" [source]="note()" />
<sone-markdown-editor
ariaLabel="Meeting note"
placeholder="Write in markdown…"
[minRows]="5"
[(value)]="draft"
/>
</div>Importación
import {
SoneFloatingDockDirective,
SoneMarkdownComponent,
SoneMarkdownEditorComponent,
SoneMarkdownEditorFooterDirective,
SoneMarkdownEditorToolsDirective,
SoneMarkdownPreviewDirective,
} from "@surface-one/angular/markdown";Referencia de la API
SoneFloatingDockDirectiveDirectiva
| Nombre | Tipo | Predeterminado |
|---|---|---|
soneFloatingDock | boolean | false |
floatingDockAnchorobligatorio | HTMLElement | — |
SoneMarkdownComponentComponente
| Nombre | Tipo | Predeterminado |
|---|---|---|
source | string | null | undefined | "" |
size | MarkdownSize | "default" |
breaks | boolean | true |
SoneMarkdownEditorComponentComponente
| Nombre | Tipo | Predeterminado |
|---|---|---|
valuebidireccional | string | "" |
modebidireccional | MarkdownEditorMode | "edit" |
appearance | MarkdownEditorAppearance | "field" |
toolbar | MarkdownEditorToolbar | "full" |
stickyToolbar | boolean | false |
toolbarPlacement | MarkdownEditorToolbarPlacement | "top" |
focusFrame | boolean | true |
tabs | boolean | true |
minRows | number | 4 |
ariaLabel | string | null | null |
ariaLabelledby | string | null | null |
ariaDescribedby | string | null | null |
maxlength | number | null | null |
placeholder | string | "" |
spellcheck | boolean | true |
autocapitalize | string | "sentences" |
readonly | boolean | false |
busy | boolean | false |
invalid | boolean | false |
textareaClass | string | "" |
live | boolean | false |
imageSource | MarkdownImageResolver | null | null |
shortcuts | boolean | true |
continueLists | boolean | true |
| Nombre | Tipo |
|---|---|
editorInput | Event |
editorKeydown | KeyboardEvent |
editorPaste | ClipboardEvent |
editorDragover | DragEvent |
editorDrop | DragEvent |
editorFocus | FocusEvent |
editorBlur | FocusEvent |
selectionChange | MarkdownSelection |
toolbarCommand | MarkdownToolbarCommandEvent |