Skip to content

Components to easily build and display fake Discord messages on your webpages.

License

Notifications You must be signed in to change notification settings

Pycord-Development/discord-message-components

This branch is 47 commits ahead of Danktuary/discord-message-components:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jan 9, 2024
5398066 · Jan 9, 2024
Jan 9, 2024
Feb 15, 2021
Jan 9, 2024
Apr 4, 2021
Feb 28, 2021
Jan 10, 2021
Feb 14, 2021
Jan 9, 2024
Feb 15, 2021
Aug 1, 2021
Jan 9, 2024
Feb 28, 2021
Jan 9, 2024

Repository files navigation

Discord Message Components

Components to easily build and display fake Discord messages on your webpages. Currently available for Vue 3 and React. Vue 2 and Web Components support coming soon.

Features

  • Design modeled after Discord itself
  • Cozy and compact modes
  • Dark and light themes
  • Components for buttons, embeds, markdown, mentions, reactions, replies, and slash commands
  • Simple syntax!

Storybook

Publishing soon!

Docs

Coming soon!

Installation and usage

@discord-message-components preview

Vue

Refer to @pycord/discord-message-components-vue's README for full notes and examples.

yarn add @pycord/discord-message-components-vue
# or npm install @pycord/discord-message-components-vue
import { createApp } from 'vue'
import { install as DiscordMessageComponents } from '@pycord/discord-message-components-vue'
import App from './App.vue'
import '@pycord/discord-message-components-vue/dist/style.css'

const app = createApp(App)

// Only necessary if you want to provide plugin options
app.use(DiscordMessageComponents, { /*...*/ })

app.mount('#app')
<template>
	<DiscordMessages>
		<DiscordMessage>
			Hello, World!
		</DiscordMessage>
	</DiscordMessages>
</template>

<script setup>
import { DiscordMessage, DiscordMessages } from '@pycord/discord-message-components-vue'
</script>

React

Refer to @pycord/discord-message-components-react's README for full notes and examples.

yarn add @pycord/discord-message-components-react
# or npm install @pycord/discord-message-components-react
import React from 'react'
import { DiscordMessage, DiscordMessages } from '@pycord/discord-message-components-react'
import '@pycord/discord-message-components-react/dist/style.css'

export default function App() {
	return (
		<DiscordMessages>
			<DiscordMessage>
				Hello, World!
			</DiscordMessage>
		</DiscordMessages>
	)
}

General notes

There are a few clear differences between these packages and actual Discord. These packages aren't meant to be a pixel-perfect mock of Discord. Some of these differences would be:

  • These packages use the Roboto font, which is not Discord's default font. You can override this with .discord-messages { font-family: ... } in your CSS.
  • Certain icons (such as the ephemeral message icon, verified bot tag icon, etc.) are not included. This may change in the future, but will use free SVG icons as opposed to ones identical to Discord's.
  • Markdown spoilers will display the inner content upon hover instead of upon being clicked.

These packages were made to help developers improve their websites (such as guides, bot dashboards, etc.) by replacing images with code. I do not own any assets used in these packages and do not intend to infringe on any of Discord's copyright. Please contact me if there are any issues in this regard.

About

Components to easily build and display fake Discord messages on your webpages.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages

  • TypeScript 55.3%
  • Vue 16.5%
  • CSS 16.3%
  • JavaScript 11.8%
  • Shell 0.1%