1.4.0 • Published 2 years ago

react-accessbile-avatarpeeps v1.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

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

⚒ API


name

Type of name

  • Identify avatar component
TypeRequired
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,Peep30Yes

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
TypeRequired
stringNo

borderRadius

  • border-radius of avatar
TypeRequired
stringNo

color

  • The color of the avatar outline
  • default : #000

    TypeRequired
    stringNo

backgroundColor

  • The color of the background
  • default: none
TypeRequired
stringNo
1.4.0

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

3 years ago

1.0.0

3 years ago