Expand description
svg element let’s you display SVG code.
For dynamic SVGs you may use dynamic_bytes.
§Example
static FERRIS: &[u8] = include_bytes!("_docs/ferris.svg");
fn app() -> Element {
let ferris = static_bytes(FERRIS);
rsx!(
svg {
svg_data: ferris,
width: "100%", // You must specify size otherwhise it will default to 0
height: "100%",
}
)
}Constants§
- a11y_
access_ key - a11y_
author_ id - a11y_
auto_ complete - a11y_
auto_ focus - a11y_
busy - a11y_
color_ value - a11y_
column_ count - a11y_
column_ index - a11y_
column_ index_ text - a11y_
column_ span - a11y_
current - a11y_
default_ action_ verb - a11y_
description - a11y_
disabled - a11y_
expanded - a11y_
focusable - a11y_
has_ popup - a11y_
hidden - a11y_
hovered - a11y_id
- a11y_
invalid - a11y_
is_ grammar_ error - a11y_
is_ search_ match - a11y_
is_ spelling_ error - a11y_
is_ suggestion - a11y_
keyboard_ shortcut - a11y_
language - a11y_
level - a11y_
linked - a11y_
list_ style - a11y_
live - a11y_
live_ atomic - a11y_
max_ numeric_ value - a11y_
min_ numeric_ value - a11y_
modal - a11y_
multiselectable - a11y_
name - a11y_
numeric_ value - a11y_
numeric_ value_ jump - a11y_
numeric_ value_ step - a11y_
orientation - a11y_
placeholder - a11y_
position_ in_ set - a11y_
read_ only - a11y_
required - a11y_
role - a11y_
role_ description - a11y_
row_ count - a11y_
row_ index - a11y_
row_ index_ text - a11y_
row_ span - a11y_
scroll_ x - a11y_
scroll_ x_ max - a11y_
scroll_ x_ min - a11y_
scroll_ y - a11y_
scroll_ y_ max - a11y_
scroll_ y_ min - a11y_
selected - a11y_
size_ of_ set - a11y_
sort_ direction - a11y_
state_ description - a11y_
toggled - a11y_
tooltip - a11y_
touch_ transparent - a11y_
url - a11y_
value - a11y_
vertical_ offset - a11y_
visited - color
- The
colorattribute lets you specify the color of the text. - fill
- The
fillattributes allows you to specify the fill color for thesvg. - height
- Specify the height for the given element.
- layer
- Controls the stacking order of elements on the z-axis.
- margin
- Specify the margin of an element. You can do so by four different ways, just like in CSS.
- max_
height - Specify a maximum height for the given element.
- max_
width - Specify a maximum width for the given element.
- min_
height - Specify a minimum height for the given element. This can be useful if you use it alongside a percentage for the target size.
- min_
width - Specify a minimum width for the given element. This can be useful if you use it alongside a percentage for the target size.
- opacity
- Specify the opacity for this element.
- position
- Specify how you want the element to be positioned inside it’s parent area.
- position_
bottom - Specify the bottom position of an element when using
position: "absolute"orposition: "global". This supports pixels only. - position_
left - Specify the left position of an element when using
position: "absolute"orposition: "global". This supports pixels only. - position_
right - Specify the right position of an element when using
position: "absolute"orposition: "global". This supports pixels only. - position_
top - Specify the top position of an element when using
position: "absolute"orposition: "global". This supports pixels only. - rotate
- Specify the rotation for this element.
- stroke
- The
strokeattributes allows you to specify stroke color for thesvg. - svg_
content - The
svg_contentattribute lets you provide SVG content as a string. - svg_
data - The
svg_dataattribute lets you provide raw SVG data directly. - width
- Specify the width for the given element.