SVG
Renders a complete inline SVG document without loading external SVG resources.
Loading interactive demo…
func SvgExample() *ui.Element {
return ui.SVG().
Width(20).
Height(20).
TextColor("#2563eb").
Value(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M11 4h2v7h7v2h-7v7h-2v-7H4v-2h7z"/></svg>`)
}#Import
Import ui from github.com/egoist/quickgui/go/ui.
import (
"github.com/egoist/quickgui/go/ui"
)#Usage
func SvgExample() *ui.Element {
return ui.SVG().
Width(20).
Height(20).
TextColor("#2563eb").
Value(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M11 4h2v7h7v2h-7v7h-2v-7H4v-2h7z"/></svg>`)
}#API reference
Expand an entry for its description and complete signature. A dash means no declaration default is documented.
SVG
View sourceui.SVG() *ElementSVG renders inline SVG markup supplied through Value using the Rust renderer.
ChildChild(child any) *Element—
Child appends content and returns this element. Content can be an element, native node, scalar, accessor, or node-returning construction callback.
Child(child any) *ElementView sourceChildrenChildren(children ...any) *Element—
Children appends multiple children in order without replacing existing content. It also accepts []any, []*Element, and []*native.Node slices as arguments. Read the retained child nodes through element.Node.Children.
Children(children ...any) *ElementView sourceStyleStyle(style StyleBuilder) *Element—
Style merges a reusable style. Scalar accessors retain independent native bindings.
Style(style StyleBuilder) *ElementView sourceOnClickOnClick(handler func()) *Element—
OnClick handles a click without an unused event parameter.
OnClick(handler func()) *ElementView sourceRefRef(handler func(*native.Node)) *Element—
Ref exposes the native handle once at this point in the declaration chain.
Ref(handler func(*native.Node)) *ElementView sourcePaddingPadding(value any) *Element—
BackgroundColorBackgroundColor(value any) *Element—
BackgroundColor sets the corresponding style property.
BackgroundColor(value any) *ElementView sourceOnKeyDownOnKeyDown(value func(*native.Event)) *Element—
OnKeyDown configures the corresponding node property.
OnKeyDown(value func(*native.Event)) *ElementView sourceOnFocusOnFocus(value func(*native.Event)) *Element—
OnFocus configures the corresponding node property.
OnFocus(value func(*native.Event)) *ElementView sourceOnBlurOnBlur(value func(*native.Event)) *Element—
OnBlur configures the corresponding node property.
OnBlur(value func(*native.Event)) *ElementView source