Giter Site home page Giter Site logo

alynva / react-undraw Goto Github PK

View Code? Open in Web Editor NEW

This project forked from justinlettau/react-undraw

0.0 0.0 0.0 32.53 MB

React component for unDraw illustrations.

Home Page: https://justinlettau.github.io/react-undraw

JavaScript 71.10% TypeScript 28.90%

react-undraw's Introduction

NPM Version CI Dependency Status Dev Dependency Status

React unDraw

React component for unDraw illustrations.

Table of Contents

Features

  • ๐Ÿš€ Works with any illustration from unDraw.
  • ๐ŸŽจ Customize colors with props.
  • ๐ŸŽ‰ Written in TypeScript.
  • ๐ŸŽ Smaller bundles by only including what you need.

Installation

npm install react-undraw --save

Usage

import Undraw from 'react-undraw';

// optionally override default props
Undraw.defaultProps.primaryColor = 'darkblue';

<Undraw name="coding" />;

Props:

Prop Type Description Default
name string Illustration file name (without extension). n/a
primaryColor string Illustration primary color. #6c63ff
height string Illustration height. 250px

Illustrations

Bring your own illustrations! To comply with the updated unDraw license, we can't bundle the illustrations with this package ๐Ÿ˜ž However, this means you can always use the latest illustrations! ๐Ÿ˜Ž

Here's what you need to do:

  • Download any illustrations you want from unDraw.
    • No need to change the color before download, use primaryColor prop instead.
    • Optional: rename file to remove prefix/suffix (undraw_barbecue_3x93.svg => barbecue.svg).
    • The name prop will need to match your file name.
  • Put SVG files in an undraw folder at the root of your project.
  • Add react-undraw-cli to your build and/or start script:
    • "prebuild": "react-undraw-cli"
    • or ... "build": "react-undraw-cli && react-scripts build"

Example project structure:

package.json
src/
 ...
undraw/
  coding.svg
  hologram.svg
  ice_cream.svg
  ...

Development

npm install
npm run build

react-undraw's People

Contributors

justinlettau avatar renovate[bot] avatar renovate-bot avatar alynva avatar andreimc avatar fnowacki avatar marklawlor avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.