Skip to content
On this page

How to use the library with React Native?

To use DiceBear with React Native you need an SVG library to render the avatars. In our example we use the package react-native-svg.

First install the required packages:

npm install react-native-svg

A working example looks like this:

import { View } from 'react-native';
import { createAvatar } from '@dicebear/core';
import { lorelei } from '@dicebear/collection';
import { SvgXml } from 'react-native-svg';

export default function App() {
  const avatar = createAvatar(lorelei, {
    seed: 'Kitty',
    // ... other options

  return (
      <SvgXml xml={avatar} />