Skip to content
ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Discord Components Pro

Professional React SDK for building Discord Components v2 with visual editor, drag & drop, and TypeScript support.

TypeScript React License Tests Coverage


โœจ Features

๐ŸŽจ Visual Editor

  • MessageBuilder - Complete visual editor with drag & drop
  • Live Preview - Real-time Discord-style preview
  • Undo/Redo - Full history management
  • Themes - Dark/Light mode support

๐Ÿ“ฆ Components (16)

  • Core: Button, TextDisplay, StringSelect, Container, ActionRow, Separator
  • Advanced: Dialog, EmojiPicker, ColorPicker, FileUpload, MediaGallery, MarkdownPreview
  • Utility: Thumbnail, SortableItem, Icon, MessageBuilder

๐Ÿ”ง Features (13 Modules)

  • ๐Ÿ“ค Export - JSON, Discord.js, TypeScript, Python
  • ๐Ÿ“ฅ Import - From JSON with validation
  • ๐ŸŽจ Drag & Drop - Reorder components visually
  • โฎ๏ธ History - Undo/redo system
  • โŒจ๏ธ Keyboard - Customizable shortcuts
  • ๐Ÿ” Search - Find components quickly
  • โœ… Validation - Discord API limits
  • ๐Ÿ“‹ Clipboard - Copy/paste components
  • ๐ŸŽฏ Analytics - Usage tracking
  • ๐Ÿ“ฆ Batch - Mass operations
  • ๐Ÿ“ Markdown - Discord markdown support
  • ๐ŸŽจ Theme - Custom themes
  • โšก Performance - Optimized hooks

๐Ÿš€ Developer Experience

  • โœ… 305 Tests - 100% passing, 85% coverage
  • ๐Ÿ“š Full TypeScript - Complete type safety
  • ๐ŸŽฏ Tree-shakeable - Import only what you need
  • โ™ฟ Accessible - WCAG compliant
  • ๐Ÿ—๏ธ Modular - Clean architecture

๐Ÿ“ฆ Installation

npm install @chumadev/discord-components-pro
# or
yarn add @chumadev/discord-components-pro
# or
pnpm add @chumadev/discord-components-pro

๐Ÿš€ Quick Start

import { MessageBuilder } from '@chumadev/discord-components-pro';
import '@chumadev/discord-components-pro/discord-components-pro.css';

function App() {
  return (
    <MessageBuilder 
      theme="dark" 
      editable 
    />
  );
}

๏ฟฝ Usage Examples

Basic Component

import { Button, ButtonStyle } from '@chumadev/discord-components-pro';

function MyComponent() {
  return (
    <Button 
      style={ButtonStyle.Primary}
      label="Click Me"
      customId="my-button"
    />
  );
}

Visual Editor

import { MessageBuilder, useComponentStore } from '@chumadev/discord-components-pro';

function Editor() {
  const { components } = useComponentStore();
  
  return (
    <div>
      <MessageBuilder theme="dark" editable />
      <pre>{JSON.stringify(components, null, 2)}</pre>
    </div>
  );
}

Export to Discord.js

import { useExport } from '@chumadev/discord-components-pro';

function ExportButton() {
  const { exportToFormat } = useExport();
  
  const handleExport = () => {
    const result = exportToFormat(components, { format: 'discord.js' });
    console.log(result.content);
  };
  
  return <button onClick={handleExport}>Export</button>;
}

Keyboard Shortcuts

import { useKeyboardShortcuts } from '@chumadev/discord-components-pro';

function MyComponent() {
  useKeyboardShortcuts([
    { key: 's', ctrl: true, action: () => save() },
    { key: 'z', ctrl: true, action: () => undo() },
  ]);
  
  return <div>Press Ctrl+S to save</div>;
}

๐ŸŽจ Export Formats

JSON

{
  "type": 2,
  "style": 1,
  "label": "Click me",
  "custom_id": "button_1"
}

Discord.js

new ButtonBuilder()
  .setStyle(ButtonStyle.Primary)
  .setLabel('Click me')
  .setCustomId('button_1')

TypeScript

const button: ButtonComponent = {
  type: 2,
  style: 1,
  label: 'Click me',
  custom_id: 'button_1'
};

Python

button = {
    "type": 2,
    "style": 1,
    "label": "Click me",
    "custom_id": "button_1"
}

๐Ÿ“Š Bundle Size

Format Size Gzipped
ES Module 998 KB 240 KB
UMD 830 KB 217 KB
CSS 27 KB 4.5 KB

Tree-shakeable - Import only what you need!


๐Ÿ—๏ธ Architecture

src/
โ”œโ”€โ”€ components/       # 16 React components
โ”œโ”€โ”€ features/         # 13 feature modules
โ”‚   โ”œโ”€โ”€ export/       # Export to multiple formats
โ”‚   โ”œโ”€โ”€ import/       # Import with validation
โ”‚   โ”œโ”€โ”€ dnd/          # Drag & drop system
โ”‚   โ”œโ”€โ”€ history/      # Undo/redo
โ”‚   โ”œโ”€โ”€ keyboard/     # Keyboard shortcuts
โ”‚   โ”œโ”€โ”€ validation/   # Discord API validation
โ”‚   โ””โ”€โ”€ ...           # 7 more modules
โ”œโ”€โ”€ hooks/            # React hooks
โ”œโ”€โ”€ store/            # Zustand state management
โ”œโ”€โ”€ types/            # TypeScript definitions
โ””โ”€โ”€ utils/            # Utility functions

๐Ÿ› ๏ธ Development

# Install
npm install

# Dev server (playground)
npm run dev

# Build
npm run build

# Tests
npm test

# Type check
npm run typecheck

# Lint
npm run lint

๐Ÿงช Testing

  • 305 tests - 100% passing
  • 85% coverage - All critical paths covered
  • Vitest - Fast unit testing
  • React Testing Library - Component testing
npm test              # Run all tests
npm test -- --watch   # Watch mode
npm run test:coverage # Coverage report

๐ŸŒ Browser Support

  • Chrome/Edge 90+
  • Firefox 88+
  • Safari 14+
  • Modern browsers with ES2020

๐Ÿ“ License

MIT ยฉ 2026 ChumaDev


๐Ÿ”— Links


๐Ÿ™ Credits

Built with:


โš ๏ธ Disclaimer

This is an independent community project, NOT affiliated with Discord Inc. or Discord.js.


Made with โค๏ธ by ChumaDev

About

Professional React SDK for Discord Components v2 with visual editor, drag & drop, and export to multiple formats

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages