Back to Kibana

Markdown

src/platform/packages/shared/shared-ux/markdown/impl/README.mdx

9.4.02.1 KB
Original Source

Description

This markdown component uses the EuiMarkdownEditor and EuiMarkdownFormat managed by @elastic/eui. If readOnly is set to true, and markdownContent or children are set, then the component renders EuiMarkdownFormat text. Otherwise the component will render the EuiMarkdownEditor. The height of the component can be set, but in order the control the width of the component, you can place the <Markdown /> component in another component. Markdown extends all the EuiMarkdownEditorProps except for the editorId, uiPlugins, and MarkdownFormatProps. Like the legacy React <Markdown> component, style can be set but will only be passed to EuiMarkdownFormat.

Component Properties

Prop NameTypeDescription
readOnlybooleanNeeded to differentiate where markdown is used as a presentation of error messages. This was previous the MarkdownSimple component
openLinksInNewTabbooleanAn optional property needed to replace the Markdown component from kibana-react
markdownContentstringThis prop can be set along with readOnly to display error.message etc text to the kibana user. This property is optional.
ariaLabelContentstringAn optional property to be set for the markdown component. It will be markdown component if not set explicitly.
heightnumber or 'full'The height of the markdown component can be set to a number. By default, height is set to 'full'. To set the width, include a container for the markdown component to be within with set width.
placeholderstring or undefinedThis prop can be set to a string to display the placeholder content of the markdown component.
defaultValuestringThe default value for the markdown editor. If not set it will default to an empty string.

API

ExportDescription
MarkdownThis component provides a markdown editor or text to be supported with Markdown formatting (must have static content set for the markdownContent) prop and be readOnly
MarkdownPropsExported by @kbn/shared-ux-markdown-types