pub struct svg;
Expand description
svg
element let’s you display SVG code.
You will need to use the bytes_to_data
to transform the bytes into data the element can recognize.
Example:
static FERRIS: &[u8] = include_bytes!("./ferris.svg");
fn app(cx: Scope) -> Element {
let ferris = bytes_to_data(cx, FERRIS);
render!(
svg {
svg_data: ferris,
}
)
}
Implementations§
§impl svg
impl svg
pub const margin: (&'static str, Option<&'static str>, bool) = _
pub const margin: (&'static str, Option<&'static str>, bool) = _
margin
Specify the margin of an element. You can do so by three different ways, just like in CSS.
fn app(cx: Scope) -> Element {
render!(
rect {
margin: "25" // 25 in all sides
margin: "100 50" // 100 in top and bottom, and 50 in left and right
margin: "5 7 3 9" 5 // in top, 7 in right, 3 in bottom and 9 in left
}
)
}
pub const height: (&'static str, Option<&'static str>, bool) = _
pub const height: (&'static str, Option<&'static str>, bool) = _
width and height
Specify the width and height for the given element.
See syntax in Size Units
.
Example:
fn app(cx: Scope) -> Element {
render!(
rect {
background: "red",
width: "15",
height: "50",
}
)
}
pub const width: (&'static str, Option<&'static str>, bool) = _
pub const svg_data: (&'static str, Option<&'static str>, bool) = _
pub const svg_content: (&'static str, Option<&'static str>, bool) = _
pub const role: (&'static str, Option<&'static str>, bool) = _
pub const focus_id: (&'static str, Option<&'static str>, bool) = _
pub const alt: (&'static str, Option<&'static str>, bool) = _
pub const name: (&'static str, Option<&'static str>, bool) = _
pub const focusable: (&'static str, Option<&'static str>, bool) = _
Auto Trait Implementations§
impl RefUnwindSafe for svg
impl Send for svg
impl Sync for svg
impl Unpin for svg
impl UnwindSafe for svg
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more