@abdt/avatars 中文文档教程
A collection of avatars by ABDT
Размер
import React from 'react'
import { Dolphin } from '@abdt/avatars';
const DolphinIcon = () => <Dolphin />
Вариация
import React from 'react'
import DolphinSVG from '@abdt/avatars/Dolphin.svg';
const DolphinIcon = () => <img src={DolphinSVG} alt="" />;
Использование сgenerateAvatarFromString
import React from 'react'
import * as avatarComponents from '@abdt/avatars';
import generateAvatarFromString from '@abdt/avatars/dist/esm/generateAvatarFromString';
const AvatarUsername = avatarComponents[generateAvatarFromString("Username", avatarComponents)];
<AvatarUsername />
A collection of avatars by ABDT
Размер
import React from 'react'
import { Dolphin } from '@abdt/avatars';
const DolphinIcon = () => <Dolphin />
Вариация
import React from 'react'
import DolphinSVG from '@abdt/avatars/Dolphin.svg';
const DolphinIcon = () => <img src={DolphinSVG} alt="" />;
Использование с generateAvatarFromString
import React from 'react'
import * as avatarComponents from '@abdt/avatars';
import generateAvatarFromString from '@abdt/avatars/dist/esm/generateAvatarFromString';
const AvatarUsername = avatarComponents[generateAvatarFromString("Username", avatarComponents)];
<AvatarUsername />