Module svg

Source
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 color attribute lets you specify the color of the text.
fill
The fill attributes allows you to specify the fill color for the svg.
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" or position: "global". This supports pixels only.
position_left
Specify the left position of an element when using position: "absolute" or position: "global". This supports pixels only.
position_right
Specify the right position of an element when using position: "absolute" or position: "global". This supports pixels only.
position_top
Specify the top position of an element when using position: "absolute" or position: "global". This supports pixels only.
rotate
Specify the rotation for this element.
stroke
The stroke attributes allows you to specify stroke color for the svg.
svg_content
The svg_content attribute lets you provide SVG content as a string.
svg_data
The svg_data attribute lets you provide raw SVG data directly.
width
Specify the width for the given element.