shiny.semantic
shiny.semantic copied to clipboard
Add custom svg icons collected in one sprite map
As an enhancement feature, we could make users able to add their own custom svg icons, collected in one sprite map svg file and having unique ids. Embedding svg icons using a sprite-map ( tags with src attribute pointing to specific svg file, gives the possibility to manipulate svg element's css properties, like fill, stroke etc. Thus it's possible to add some nice visual effects on events, like hover, click etc, which is not so simple or sometimes impossible, when using
elements.
Some example function I created and used as a helper function, to return svg icon based on icons.svg sprite map:
svg_icon <- function(id, class, width, height) {
return(
HTML(
glue::glue("
<svg class = '{class}', viewBox = '0 0 {width} {height}'>
<use href = 'icons/icons.svg#{id}'></use>
</svg>"
)
)
)
}
How do we use the function, please? Are there any examples?
Hi @Bill-Gesora,
This functionality is currently under development. https://github.com/Appsilon/shiny.semantic/pull/320 We will include an example shiny app using custom sprite map. At this development stage I cannot advice you about the code above for using custom sprite maps. It has not been fully yet tested and the function code probably will change before it is released.
@osenan Do you think there will be future development from your side on this issue? Currently, we are closing all the idle issues as a part of a general clean-up we started.
Closing. Feel free to reopen it