# react-undraw

> React component for unDraw illustrations.

Latest version **2.0.3** (published 2021-02-17) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install react-undraw
pnpm add react-undraw
yarn add react-undraw
bun add react-undraw
```

Provides the command `react-undraw-cli`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2021-02-17 |
| First published | 2018-10-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 14 |
| Unpacked size | 29.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Author | Justin Lettau |
| Maintainers | justinlettau |
| Keywords | undraw, illustrations, react, reactjs, svg |

## Links

- npm: https://www.npmjs.com/package/react-undraw
- Repository: https://github.com/justinlettau/react-undraw
- Issues: https://github.com/justinlettau/react-undraw/issues
- npm.io page: https://npm.io/package/react-undraw

## Dependencies (14)

- [del](https://npm.io/package/del.md) ^5.1.0
- [glob](https://npm.io/package/glob.md) ^7.1.6
- [fs-extra](https://npm.io/package/fs-extra.md) ^9.0.0
- [@svgr/core](https://npm.io/package/@svgr/core.md) ^5.3.0
- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2
- [@types/jest](https://npm.io/package/@types/jest.md) ^25.1.4
- [@types/node](https://npm.io/package/@types/node.md) ^12.12.32
- [pascal-case](https://npm.io/package/pascal-case.md) ^3.1.1
- [@types/react](https://npm.io/package/@types/react.md) ^16.9.27
- [app-root-path](https://npm.io/package/app-root-path.md) ^3.0.0
- [@svgr/plugin-jsx](https://npm.io/package/@svgr/plugin-jsx.md) ^5.3.0
- [@types/react-dom](https://npm.io/package/@types/react-dom.md) ^16.9.5
- [@svgr/plugin-svgo](https://npm.io/package/@svgr/plugin-svgo.md) ^5.3.0
- [@svgr/plugin-prettier](https://npm.io/package/@svgr/plugin-prettier.md) ^5.3.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.0.3 (latest) — 2021-02-17
- 2.0.0-beta.1 (beta) — 2020-03-31
- 2.0.2 — 2020-10-01
- 2.0.1 — 2020-06-24
- 2.0.0 — 2020-06-14
- 2.0.0-beta.0 — 2020-03-31
- 1.14.0 — 2019-03-23
- 1.13.0 — 2019-03-03
- 1.12.0 — 2019-02-13
- 1.11.0 — 2019-02-07
- 1.10.0 — 2019-01-25
- 1.9.0 — 2019-01-20
- 1.8.0 — 2019-01-18
- 1.7.0 — 2019-01-04
- 1.6.0 — 2018-12-22
- … 7 more at https://npm.io/package/react-undraw/versions

## README

[![NPM Version](https://badge.fury.io/js/react-undraw.svg)](https://badge.fury.io/js/react-undraw)
![CI](https://github.com/justinlettau/react-undraw/workflows/CI/badge.svg)
[![Dependency Status](https://david-dm.org/justinlettau/react-undraw.svg)](https://david-dm.org/justinlettau/react-undraw)
[![Dev Dependency Status](https://david-dm.org/justinlettau/react-undraw/dev-status.svg)](https://david-dm.org/justinlettau/react-undraw?type=dev)

# React unDraw

React component for [unDraw illustrations](https://undraw.co/).

# Table of Contents

- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Illustrations](#illustrations)
- [Development](#development)

# Features

- 🚀 Works with **any illustration** from unDraw.
- 🎨 **Customize colors** with props.
- 🎉 Written in **TypeScript**.
- 🎁 **Smaller bundles** by only including what you need.

# Installation

```bash
npm install react-undraw --save
```

# Usage

```jsx
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](https://undraw.co/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](https://undraw.co/illustrations).
  - 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
```

---
_Source: https://npm.io/package/react-undraw · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
