Markdown
保持型の Markdown を描画し、ストリーミング内容向けの差分更新にも対応します。
デモを読み込み中…
func MarkdownExample(source string, streaming bool) *ui.Element {
return markdown.View(markdown.Props{
Value: source,
Streaming: streaming,
CodeBlockComponent: editor.HighlightedCodeBlock,
}).Width("100%")
}#インポート
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"
)#使い方
func MarkdownExample(source string, streaming bool) *ui.Element {
return markdown.View(markdown.Props{
Value: source,
Streaming: streaming,
CodeBlockComponent: editor.HighlightedCodeBlock,
}).Width("100%")
}#API リファレンス
項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。
markdown.View
ソースを見るmarkdown.View(props Props) *ui.ElementStyleStyleBuilder—
Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.
StyleBuilderソースを見るChildrenany—
Content mounted inside the component. Compound child callbacks run after the parent context exists.
anyソースを見るOnClickfunc(*native.Event)—
Called after QuickGUI resolves an activation, including supported keyboard activation.
func(*native.Event)ソースを見るOnMouseEnterfunc(*native.Event)—
OnMouseLeavefunc(*native.Event)—
OnInputfunc(*native.Event)—
Receives edits from the text control. Write the new text into the controlled value.
func(*native.Event)ソースを見るOnSubmitfunc(*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)ソースを見るOnSelectfunc(*native.Event)—
OnKeyDownfunc(*native.Event)—
OnKeyUpfunc(*native.Event)—
OnMouseDownfunc(*native.Event)—
OnMouseUpfunc(*native.Event)—
OnMouseMovefunc(*native.Event)—
OnDoubleClickfunc(*native.Event)—
OnWheelfunc(*native.Event)—
OnContextMenufunc(*native.Event)—
OnPinchfunc(*native.Event)—
OnRotatefunc(*native.Event)—
OnSmartMagnifyfunc(*native.Event)—
OnPressurefunc(*native.Event)—
OnFocusfunc(*native.Event)—
OnBlurfunc(*native.Event)—
OnActionfunc(*native.Event)—
OnDragStartfunc(*native.Event)—
OnDragEndfunc(*native.Event)—
OnDropfunc(*native.Event)—
OnFilesDroppedfunc(*native.Event)—
OnComponentChangefunc(*native.Event)—
Receives the component change payload, including values for coordinated controls.
func(*native.Event)ソースを見るOnCommitfunc(*native.Event)—
Disabledany—
Prevents activation and exposes the disabled state to accessibility. Compound parts inherit a disabled root.
anyソースを見るValueany—
The current controlled value. Update application state from the change callback to accept a new value.
anyソースを見るPlaceholderstring—
Multilinebool—
AriaLabelany—
Selectedany—
Groupany—
FocusOnPointerany—
FocusableWhenDisabledany—
HitSlopany—
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)ソースを見るPasswordany—
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.
anyソースを見るOverlayany—
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.
anyソースを見るCodeBlockComponentany—
CodeBlockMaxHeightany—
Configures code block max height for this part. The declared type and source define the accepted value.
anyソースを見る