aicers / frontary

Reusable HTML components using Yew for AICE
Apache License 2.0
0 stars 0 forks source link

Add `Svg` for fetching and displaying SVG files #109

Closed sehkone closed 3 months ago

sehkone commented 3 months ago

Close #105

The new component, Svg, fetches an SVG file from the server and displays it dynamically. Here are some examples:

When only the path of the SVG file is provided, the div element containing the svg will have the same width and height as the svg.

<Svg path="/img/Logo.svg" />

When a width and/or height is specified, the div will have those dimensions.

<Svg path="/img/Logo.svg" width={200} height={100} />

A class name for styling can also be given.

<Svg path="/img/Logo.svg" class="logo" />