eQuantic.UIeQuantic.UI
Docs
Playground
GitHub
DocsÖkosystem
eQuantic.UI.Lottie
Edit this page
1 min read
Das Paket eQuantic.UI.Lottie bietet performante Animationsunterstützung über die Formate .lottie und .json mithilfe der Web-Komponente @dotlottie/player-component.
Installation
Fügen Sie das Paket Ihrem Projekt hinzu und registrieren Sie den Dienst:
1
2
3
4
builder.Services.AddUI(options =>
{
options.UseLottie();
});
Grundlegende Nutzung
Die Komponente LottiePlayer übernimmt das Laden der Assets automatisch über IRequireAssets.
1
2
3
4
5
6
7
new LottiePlayer
{
Src = "https://assets.lottiefiles.com/animation.json",
Autoplay = true,
Loop = true,
Width = "300px"
}
dotLottie-Unterstützung
Das Format .dotlottie wird empfohlen, wegen kleinerer Dateien und besserer Performance.
1
2
3
4
5
6
new LottiePlayer
{
Src = "https://example.com/animation.lottie",
Height = "400px",
Controls = true
}
Eigenschaften
Eigenschaft
Typ
Beschreibung
Src
string
URL der Animationsdatei (.json oder .dotlottie).
Autoplay
bool
Startet die Animation automatisch. Standard: true.
Loop
bool
Spielt die Animation in einer Schleife. Standard: true.
Speed
double
Multiplikator der Abspielgeschwindigkeit. Standard: 1.
Background
string
Hintergrundfarbe. Standard: transparent.
Width
string?
Die CSS-Eigenschaft width.
Height
string?
Die CSS-Eigenschaft height.
Controls
bool
Zeigt die native Steuerungsoberfläche des Players.