SVG display -- renders a vector image from a file path.
Props
source(string) -- path to the SVG file.width(length) -- SVG width. Default: shrink. SeeToddy.Iced.Length.height(length) -- SVG height. Default: shrink.content_fit-- how the SVG fits its bounds. SeeToddy.Iced.ContentFit.rotation(number) -- rotation angle in degrees.opacity(number) -- opacity from 0.0 (transparent) to 1.0 (opaque).color(color) -- color tint applied to the SVG. SeeToddy.Iced.Color.alt(string) -- alt text for the SVG (accessibility).description(string) -- longer description for the SVG (accessibility).a11y(map) -- accessibility overrides. SeeToddy.Iced.A11y.
Summary
Functions
Sets accessibility annotations.
Sets the alt text for the SVG.
Converts this SVG struct to a ui_node() map via the Toddy.Iced.Widget protocol.
Sets the color tint applied to the SVG.
Sets how the SVG fits its bounds.
Sets a longer description for the SVG.
Sets the SVG height.
Creates a new SVG struct with the given source path and optional keyword opts.
Sets the SVG opacity.
Sets the rotation angle in degrees.
Sets the SVG width.
Applies keyword options to an existing SVG struct.
Types
@type option() :: {:width, Toddy.Iced.Length.t()} | {:height, Toddy.Iced.Length.t()} | {:content_fit, Toddy.Iced.ContentFit.t()} | {:rotation, number()} | {:opacity, number()} | {:color, Toddy.Iced.Color.input()} | {:alt, String.t()} | {:description, String.t()} | {:a11y, Toddy.Iced.A11y.t()}
@type t() :: %Toddy.Iced.Widget.Svg{ a11y: Toddy.Iced.A11y.t() | nil, alt: String.t() | nil, color: Toddy.Iced.Color.t() | nil, content_fit: Toddy.Iced.ContentFit.t() | nil, description: String.t() | nil, height: Toddy.Iced.Length.t() | nil, id: String.t(), opacity: number() | nil, rotation: number() | nil, source: String.t(), width: Toddy.Iced.Length.t() | nil }
Functions
@spec a11y(svg :: t(), a11y :: Toddy.Iced.A11y.t()) :: t()
Sets accessibility annotations.
Sets the alt text for the SVG.
@spec build(svg :: t()) :: Toddy.Iced.ui_node()
Converts this SVG struct to a ui_node() map via the Toddy.Iced.Widget protocol.
@spec color(svg :: t(), color :: Toddy.Iced.Color.input()) :: t()
Sets the color tint applied to the SVG.
@spec content_fit(svg :: t(), content_fit :: Toddy.Iced.ContentFit.t()) :: t()
Sets how the SVG fits its bounds.
Sets a longer description for the SVG.
@spec height(svg :: t(), height :: Toddy.Iced.Length.t()) :: t()
Sets the SVG height.
Creates a new SVG struct with the given source path and optional keyword opts.
Sets the SVG opacity.
Sets the rotation angle in degrees.
@spec width(svg :: t(), width :: Toddy.Iced.Length.t()) :: t()
Sets the SVG width.
Applies keyword options to an existing SVG struct.