# react-prettify-json

> Simple React Component for displaying data in a pretty way

Latest version **1.1.1** (published 2020-04-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-prettify-json
pnpm add react-prettify-json
yarn add react-prettify-json
bun add react-prettify-json
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2020-04-24 |
| First published | 2020-04-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Bruno De Masi |
| Maintainers | brunodmsi |

## Links

- npm: https://www.npmjs.com/package/react-prettify-json
- Repository: https://github.com/brunodmsi/react-prettify-json
- Homepage: https://github.com/brunodmsi/react-prettify-json#readme
- Issues: https://github.com/brunodmsi/react-prettify-json/issues
- npm.io page: https://npm.io/package/react-prettify-json

## Recent versions

- 1.1.1 (latest) — 2020-04-24
- 1.1.0 — 2020-04-24
- 1.0.0 — 2020-04-24

## README

# Prettify JSON

> Minimalist package which makes possible for you to display your JSON as a element on your React App, personalizing the colors.

[![NPM](https://img.shields.io/npm/v/react-prettify-json.svg)](https://www.npmjs.com/package/react-prettify-json) [![JavaScript Style Guide](https://img.shields.io/badge/code%20style-airbnb-blue)](https://github.com/airbnb/javascript)

## Install

```bash
npm install --save react-prettify-json
```

## Usage

```tsx
import React from 'react';

import PrettyJSON from 'react-prettify-json';

const Example: React.FC = () =>  {
  const jsonObject = {
    "react": ">=16.0.0",
    "@unform/core": ">=5.0.0"
  }

  return (
    <PrettyJSON 
      jsonObject={jsonObject}
    />
  )
}
```
You can use that above and you're done. But, if you want a little more customization, you can set your own colors
```tsx
  <PrettyJSON 
    jsonObject={jsonObject}
    colors={{
      punctuation: '#fff',
      key: '#a3fff3',
      value: '#49cabe',
      string: '#49caeb',
    }}
  />
```
And achieve a result like this (photo took directly from my [portfolio](https://demasi.dev))    
    
![Pretty JSON Screenshot](.github/example.png)


## API
### Props
If a prop is **Required**, the `default` field will appear empty.
name | type | description | default 
--- | --- | --- | ---
jsonObject | json object (pls) | The json object that you want styled | --
colors | object: punctuation, key, value, string | Each color variable corresponds to each one of JSON data types | everything **black**


## License

MIT © [Bruno De Masi](https://github.com/brunodmsi)

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