Class Markdown

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.markdown.Markdown
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, Serializable

@Tag("vaadin-markdown") @NpmPackage(value="@vaadin/markdown", version="25.3.0-alpha1") @JsModule("@vaadin/markdown/src/vaadin-markdown.js") public class Markdown extends com.vaadin.flow.component.Component implements com.vaadin.flow.component.HasSize
Markdown is a component for rendering Markdown content. It takes Markdown source as input and renders the corresponding HTML.
Author:
Vaadin Ltd
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
    Markdown(com.vaadin.flow.signals.Signal<String> contentSignal)
    Creates a Markdown with content bound to a signal.
    Markdown(String content)
    Creates a Markdown with content.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Appends the markdown content.
    com.vaadin.flow.dom.SignalBinding<String>
    bindContent(com.vaadin.flow.signals.Signal<String> contentSignal)
    Binds the markdown content to the given signal.
    Gets the markdown content.
    protected void
    onAttach(com.vaadin.flow.component.AttachEvent attachEvent)
     
    void
    setContent(String content)
    Sets the markdown content.

    Methods inherited from class com.vaadin.flow.component.Component

    addListener, bindVisible, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, setVisible

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier

    addAttachListener

    Methods inherited from interface com.vaadin.flow.component.DetachNotifier

    addDetachListener

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasSize

    bindHeight, bindWidth, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
  • Constructor Details

    • Markdown

      public Markdown()
      Default constructor. Creates an empty Markdown.
    • Markdown

      public Markdown(String content)
      Creates a Markdown with content.
      Parameters:
      content - the markdown content
      See Also:
    • Markdown

      public Markdown(com.vaadin.flow.signals.Signal<String> contentSignal)
      Creates a Markdown with content bound to a signal.
      Parameters:
      contentSignal - the signal providing the markdown content
      See Also:
  • Method Details

    • setContent

      public void setContent(String content)
      Sets the markdown content.
      Parameters:
      content - the markdown content
    • appendContent

      public void appendContent(String content)
      Appends the markdown content.
      Parameters:
      content - the markdown content to append
    • getContent

      public String getContent()
      Gets the markdown content.
      Returns:
      the markdown content
    • bindContent

      public com.vaadin.flow.dom.SignalBinding<String> bindContent(com.vaadin.flow.signals.Signal<String> contentSignal)
      Binds the markdown content to the given signal. While the binding is active, calling setContent(String) or appendContent(String) will throw a BindingActiveException.
      Parameters:
      contentSignal - the signal providing the markdown content
      Returns:
      a SignalBinding that can be used to register onChange callbacks
    • onAttach

      protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent)
      Overrides:
      onAttach in class com.vaadin.flow.component.Component