Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gauthier-th/embed-visualizer

A React Component to render Discord-like embeds.
https://github.com/gauthier-th/embed-visualizer

discord discord-js embed react

Last synced: 4 months ago
JSON representation

A React Component to render Discord-like embeds.

Awesome Lists containing this project

README

        

# embed-visualizer

A React Component to render Discord-like embeds.

[![NPM](https://img.shields.io/npm/v/embed-visualizer.svg)](https://www.npmjs.com/package/embed-visualizer) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) ![npm bundle size](https://img.shields.io/bundlephobia/min/embed-visualizer) ![npm](https://img.shields.io/npm/dt/embed-visualizer) ![GitHub](https://img.shields.io/github/license/gauthier-th/embed-visualizer)

## Install

```bash
npm install --save embed-visualizer
```

## Usage

```jsx
import React, { Component } from 'react'

import { EmbedVisualizer, parseContent, parseTitle } from 'embed-visualizer'
import 'embed-visualizer/dist/index.css'

const embed = {
embed: {
title: "Embed title",
description: "👌 this supports [named links](https://discordapp.com), __**markdown**__ and `inline code`. ```\nyes, even code blocks```||you can also use spoilers||"
}
}

export default class Example extends Component {
render() {
return



Classic embed:


console.error("Error while parsing embed:", e)} />


Custom content parsing:



{parseTitle(embed.embed.title)}


{parseContent(embed.embed.description)}




}
}
```

## Preview

![Embed preview](https://user-images.githubusercontent.com/37781713/178846235-2bb46c81-1a24-4069-8128-a516192b7319.png)
## License

MIT © [gauthier-th](https://github.com/gauthier-th)

Created from [embed-visualizer](https://github.com/leovoel/embed-visualizer)