0.1.10 • Published 3 years ago

react-peeps v0.1.10

Weekly downloads
17
License
MIT
Repository
github
Last release
3 years ago

react-peeps

React implementation of the hand drawn illustration library called Open Peeps

Installation

npm install react-peeps

Edit react-peeps-playground

Web generator available at https://www.opeeps.fun

Usage

import React from 'react';
import ReactDOM from 'react-dom';
import Peep from 'react-peeps';

const styles = {
	peepStyle: {
		width: 300,
		height: 300,
		justifyContent: 'center',
		alignSelf: 'center'
	},
	circleStyle: {
		backgroundColor: '#F3D34A',
		width: 270,
		height: 270,
		alignSelf: 'center',
		borderRadius: 135,
		overflow: 'hidden',
		borderWidth: 3,
		borderColor: 'black',
		borderStyle: 'solid'
	},
	showcaseWrapper: {
		display: 'flex',
		justifyContent: 'center',
		height: '-webkit-fill-available'
	}
};

const Showcase: React.FC = () => {
  return (
    <div style={styles.showcaseWrapper}>
      <Peep
        style={styles.peepStyle}
        accessory='GlassRoundThick'
        body='Shirt'
        face='Cute'
        hair='ShortVolumed'
        facialHair='Dali'
        strokeColor='#e6e6e6'
        backgroundColor='red'
      />

      <Peep
        style={styles.peepStyle}
        circleStyle={styles.circleStyle}
        accessory='GlassRoundThick'
        body='Shirt'
        face='Cute'
        hair='ShortVolumed'
        facialHair='Dali'
        strokeColor='#e6e6e6'
        viewBox={{ x: '0', y: '0', width: '1050', height: '1200' }}
      />

      <Peep
        style={{...styles.peepStyle, transform: 'scale(-1, 1)'}}
        accessory='GlassRoundThick'
        body='Shirt'
        face='Cute'
        hair='ShortVolumed'
        facialHair='Dali'
        strokeColor={{degree: 300, firstColor: '#2E8A57', secondColor: '#81087F'}}
      />
    </div>
  );
};

ReactDOM.render(<Showcase />, document.getElementById('main'));

Props

AttributeTypeDescriptionRequired
accessorystringDefines the picked accessory piece nameNo
bodystringDefines the picked body typeNo
facestringDefines the picked face expression nameNo
facialHairstringDefines the picked facial hair typeNo
hairstringDefines the picked hair typeNo
styleCSSPropertiesStyle of the SVG elementNo
circleStyleCSSPropertiesWraps the SVG into a div element and passes style to that divNo
strokeColorstring | GradientTypeDefines the stroke color of linesNo
backgroundColorstring | GradientTypeDefines the background color of the peep's piecesNo
wrapperBackgroundstring | GradientTypeDefines the background of SVGNo
viewBox{ x: string; y: string; width: string; height: string; }Defines the viewable dimensions of the SVGNo

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Thanks :raised_hands:

License

MIT

0.1.10

3 years ago

0.1.8

4 years ago

0.1.9

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.3

4 years ago

0.0.5

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago