Pages
Introduction
Getting Started
Recipes
Reference
Literals
Arrays
Tuples
Type System
Functions
Modules
Records
Enums
Built-in Types
Constants
Equality
Stores
Routing
Comments
Control Expressions
Components
Properties
Computed Properties
Styling Elements
Connecting Stores
Using Providers
Internal State
Referencing Entities
Global Components
Lifecycle Functions
Directives
JavaScript Interop
Environment Variables
Packages
Svg Directive
The svg directive allows you to
inline
an SVG file as
Html
:
my-app
├── svgs
│ └── some-svg.svg
├── source
│ └── Main.mint
└── mint.json
This component inlines the
some-svg.svg
from the
svgs
folder.
component Main {
fun render : Html {
<div>
@svg(../svgs/some-svg.svg)
</div>
}
}
It's the same as copy-pasting the SVG itself into the code.