Skip to content
On this page

How to use the library with Svelte?

It is quite easy to use the JS-Library in Svelte. We convert the SVG to a data URI and use it as the src.

  import { createAvatar } from "@dicebear/core";
  import { lorelei } from "@dicebear/collection";

  let avatar = createAvatar(lorelei, {
    size: 128,
    // ... other options

<img src={avatar} alt="Avatar" />