Markdown
Renders retained Markdown, including an incremental mode for streaming content.
Loading interactive demo…
func MarkdownExample(source string, streaming bool) *ui.Element {
return markdown.View(markdown.Props{
Value: source,
Streaming: streaming,
CodeBlockComponent: editor.HighlightedCodeBlock,
}).Width("100%")
}#Import
go get github.com/egoist/quickgui/extensions/markdown github.com/egoist/quickgui/extensions/editorimport (
"github.com/egoist/quickgui/extensions/editor"
"github.com/egoist/quickgui/extensions/markdown"
"github.com/egoist/quickgui/go/ui"
)#Usage
func MarkdownExample(source string, streaming bool) *ui.Element {
return markdown.View(markdown.Props{
Value: source,
Streaming: streaming,
CodeBlockComponent: editor.HighlightedCodeBlock,
}).Width("100%")
}#API reference
Expand an entry for its description and complete signature. A dash means no declaration default is documented.
markdown.View
View sourcemarkdown.View(props Props) *ui.ElementStyleStyleBuilder—
Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.
StyleBuilderView sourceChildrenany—
Content mounted inside the component. Compound child callbacks run after the parent context exists.
anyView sourceOnClickfunc(*native.Event)—
Called after QuickGUI resolves an activation, including supported keyboard activation.
func(*native.Event)View sourceOnMouseEnterfunc(*native.Event)—
Callback for mouse enter. The signature below lists the event payload.
func(*native.Event)View sourceOnMouseLeavefunc(*native.Event)—
Callback for mouse leave. The signature below lists the event payload.
func(*native.Event)View sourceOnInputfunc(*native.Event)—
Receives edits from the text control. Write the new text into the controlled value.
func(*native.Event)View sourceOnSubmitfunc(*native.Event)—
OnDismissfunc(*native.Event)—
OnPointerfunc(*native.Event)—
OnPresentationChangefunc(*native.Event)—
Callback for presentation change. The signature below lists the event payload.
func(*native.Event)View sourceOnSelectfunc(*native.Event)—
OnKeyDownfunc(*native.Event)—
OnKeyUpfunc(*native.Event)—
OnMouseDownfunc(*native.Event)—
OnMouseUpfunc(*native.Event)—
OnMouseMovefunc(*native.Event)—
OnDoubleClickfunc(*native.Event)—
Callback for double click. The signature below lists the event payload.
func(*native.Event)View sourceOnWheelfunc(*native.Event)—
OnContextMenufunc(*native.Event)—
Callback for context menu. The signature below lists the event payload.
func(*native.Event)View sourceOnPinchfunc(*native.Event)—
OnRotatefunc(*native.Event)—
OnSmartMagnifyfunc(*native.Event)—
Callback for smart magnify. The signature below lists the event payload.
func(*native.Event)View sourceOnPressurefunc(*native.Event)—
OnFocusfunc(*native.Event)—
OnBlurfunc(*native.Event)—
OnActionfunc(*native.Event)—
OnDragStartfunc(*native.Event)—
OnDragEndfunc(*native.Event)—
OnDropfunc(*native.Event)—
OnFilesDroppedfunc(*native.Event)—
Callback for files dropped. The signature below lists the event payload.
func(*native.Event)View sourceOnComponentChangefunc(*native.Event)—
Receives the component change payload, including values for coordinated controls.
func(*native.Event)View sourceOnCommitfunc(*native.Event)—
Disabledany—
Prevents activation and exposes the disabled state to accessibility. Compound parts inherit a disabled root.
anyView sourceValueany—
The current controlled value. Update application state from the change callback to accept a new value.
anyView sourcePlaceholderstring—
Multilinebool—
AriaLabelany—
Accessible name, especially for icon-only controls or controls without a visible label.
anyView sourceSelectedany—
Groupany—
FocusOnPointerany—
FocusableWhenDisabledany—
Allows a disabled button to remain keyboard focusable while activation stays disabled.
anyView sourceHitSlopany—
HitSlopTopany—
HitSlopRightany—
HitSlopBottomany—
HitSlopLeftany—
Reffunc(*native.Node)—
Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.
func(*native.Node)View sourcePasswordany—
EstimatedItemHeightany—
Overscanany—
OverscanPixelsany—
ItemHeightsany—
ListAlignmentstring—
FollowModestring—
ObjectFitstring—
ShaderParametersany—
Invalidany—
Roleany—
TabIndexany—
Controls sequential keyboard focus order. Omit to retain the component’s default focus behavior.
anyView sourceOverlayany—
FocusTrapany—
RestorePreviousFocusany—
AutoFocusany—
AriaModalany—
DismissOnEscapeany—
DismissOnPointerOutsideany—
TooltipTextany—
TooltipPlacementany—
TooltipDelayany—
TooltipGapany—
TooltipViewportMarginany—
AnchorTargetany—
AnchorPlacementany—
AnchorGapany—
ViewportMarginany—
Keymapany—
Draggableany—
DropKindsany—
Streamingany—
Configures streaming for this part. The declared type and source define the accepted value.
anyView sourceCodeBlockComponentany—
CodeBlockMaxHeightany—
Configures code block max height for this part. The declared type and source define the accepted value.
anyView sourceThemeTheme—
Configures theme for this part. The declared type and source define the accepted value.
ThemeView source