Skip to content

Commit

Permalink
Support style attribute (#54)
Browse files Browse the repository at this point in the history
* Support `style` attribute

* Don't duplicate rsx! blocks

Co-authored-by: Marc Espin <[email protected]>

* remove duplicated xlmns attribute

---------

Co-authored-by: Marc Espin <[email protected]>
  • Loading branch information
wooden-worm and marc2332 authored Aug 24, 2024
1 parent 0cc4ba4 commit 5a63dbe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/lib/src/icon_component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ pub struct IconProps<T: IconShape + Clone + PartialEq + 'static> {
pub class: String,
/// An accessible, short-text description for the icon.
pub title: Option<String>,
/// The style of the `<svg>` element.
pub style: Option<String>,
}

/// Icon component which generates SVG elements
Expand All @@ -44,6 +46,7 @@ pub fn Icon<T: IconShape + Clone + PartialEq + 'static>(props: IconProps<T>) ->
rsx!(
svg {
class: "{props.class}",
style: props.style,
height: "{props.height}",
width: "{props.width}",
view_box: "{props.icon.view_box()}",
Expand Down

0 comments on commit 5a63dbe

Please sign in to comment.