Skip to content

sooster910/react-accessible-avatarpeeps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

25 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

example workflow

react-accessbile-avatarpeeps

Get SVG Avatar component accessible and hand-drawn style for ReactJS.

  • react-accessbile-avatarpeeps was inspired by Open Peeps which is a hand-drawn illustration library under the CC0 License.
  • An avatar component is generated by svgr.

๐ŸŒˆ Try it

online playground storybook

๐ŸŽ‰ Getting Started

npm i react-accessbile-avatarpeeps

or

yarn add react-accessbile-avatarpeeps

๐Ÿ’ซ Usage

Default avatar

import PeepAvatar from 'react-accessbile-avatarpeeps'

const Avatar = () => {
  return (
    <>
      <PeepAvatar
        name={'Peep1'}
        title={'a man width big smile'}
      />
    </>
  )
}

๐Ÿ‘‰ result

nobackground

Customized avatar

import PeepAvatar from 'react-accessbile-avatarpeeps'

const Avatar = () => {
  return (
    <>
      <PeepAvatar
        name={'Peep1'}
        title={'a man width big smile'}
        color={'#000'}
        backgroundColor={'#96C7C1'}
        borderRadius={'50%'}
        fontSize={'7em'}
      />
    </>
  )
}

๐Ÿ‘‰ result

avatar

โš’ API


name

Type of name

  • Identify avatar component
Type Required
Peep1, Peep2,, Peep3, Peep4,Peep5,Peep6,Peep7,Peep8,Peep9,Peep10,Peep11,Peep12,Peep13,Peep14,Peep15,Peep16,Peep17,Peep18,Peep19,Peep20,Peep21,Peep22,Peep23,Peep24,Peep25,Peep26,Peep27,Peep28,Peep29,Peep30 Yes

title

  • An accessible, short-text description of any SVG Type of title
  • In order to be reliable and valid SVG Accessibility, NOT recommend "peep1". Insted, prefer "Man with big smile"
    Type Required
    string Yes

fontSize

  • SVG width and height value are replaced by 1em.
  • default vallue : 1em
Type Required
string No

borderRadius

  • border-radius of avatar
Type Required
string No

color

  • The color of the avatar outline

  • default : #000

    Type Required
    string No

backgroundColor

  • The color of the background
  • default: none
Type Required
string No

About

An accessible and fun openPeeps svg avatar component library for ReactJS ๐Ÿฅธ

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published