npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

v2componentsbuilder

v2.0.0

Published

A discord.js v2components builder

Readme

V2 Discord Message Component Builder

A TypeScript-first builder library for Discord's experimental V2 Message Components.
It provides strongly typed, chainable builders for creating rich message layouts with containers, sections, media galleries, action rows, and interactive elements — with zero raw JSON hassle.

🔗 Reference: Discord Developer Docs – Message Components
🔗 Support/Hangout Discord: Golden Development
🔗 My YouTube Channel: Golden Development
🔗 My Discord Bot: Golden Bot


✨ Features

  • Build Discord V2 Message Components with full type safety
  • Chainable, ergonomic API matching Discord's new layout standards
  • Advanced structural support including Container, Section, and Media Gallery
  • Works seamlessly with discord.js, raw REST, or any interaction framework
  • Outputs valid Discord API payloads instantly

🧱 Included Builders

| Component | Builder Class | Description | |---|---|---| | Action Row | V2ActionRowBuilder | Compose select menus or buttons into Discord action rows. | | Button | V2ButtonBuilder | Build styled, interactive buttons with labels, emojis, custom IDs, and URLs. | | Channel Select | V2ChannelSelectBuilder | Choose from specific types of server channels (text, voice, etc.). | | Container | V2ContainerBuilder | Visually group components together with optional accent colors. | | File | V2FileBuilder | Attach and reference single uploaded files. | | Media Gallery | V2MediaGalleryBuilder | Display 1-10 media attachments in a gallery format. | | Mentionable Select | V2MentionableSelectBuilder | Select users or roles with a unified component. | | Role Select | V2RoleSelectBuilder | Let users choose one or more server roles. | | Section | V2SectionBuilder | Contextually associate text content with an accessory component. | | Separator | V2SeparatorBuilder | Add vertical padding and visual dividers between components. | | String Select | V2StringSelectBuilder | Create menus with up to 25 options using custom labels, values, emojis, etc. | | Text Display | V2TextDisplayBuilder | Render markdown formatted text blocks inside components. | | Thumbnail | V2ThumbnailBuilder | Display visual media in a small form-factor as an accessory. | | User Select | V2UserSelectBuilder | Select one or more users from the server dynamically. |


📦 Installation

npm install v2componentsbuilder

🚀 Example Usage

import { ButtonStyle } from 'discord-api-types/v10';
import {
  V2ComponentBuilder,
  V2ContainerBuilder,
  V2SectionBuilder,
  V2TextDisplayBuilder,
  V2ThumbnailBuilder,
  V2SeparatorBuilder,
  V2ActionRowBuilder,
  V2ButtonBuilder
} from 'v2componentsbuilder';

const message = new V2ComponentBuilder()
  .setEphemeral(false)
  .setComponents(
    new V2ContainerBuilder()
      .setId(101)
      .setColor(0xFFA500)
      .setComponents(
        new V2SectionBuilder()
          .setId(201)
          .setComponents(
            new V2TextDisplayBuilder("### 🚀 Golden Development\nPremium Discord Bot & Workflow Automation Solutions.")
          )
          .setAccessory(
            new V2ThumbnailBuilder().setURL("attachment://logo.png")
          ),
        new V2SeparatorBuilder().setId(301).setSpacing(1).setDivider(true),
        new V2SectionBuilder()
          .setId(202)
          .setComponents(
            new V2TextDisplayBuilder(
              "**Our Core Specialties:**\n" +
              "• **High-Concurrency Architectures:** High-traffic API infrastructure, load balancers, and robust queue systems.\n" +
              "• **Workflow Automation:** Full-scale integrations with n8n, monday.com, and secure PostgreSQL endpoints.\n" +
              "• **Discord Infrastructure:** Development and scaling of production-grade community suites serving millions of users."
            )
          )
          .setAccessory(
            new V2ButtonBuilder()
              .setStyle(ButtonStyle.Link)
              .setLabel("Explore Golden Bot")
              .setURL("[https://goldenbot.net](https://goldenbot.net)")
          ),
        new V2ActionRowBuilder()
          .setId(401)
          .setComponents(
            new V2ButtonBuilder()
              .setStyle(ButtonStyle.Link)
              .setLabel("Join Our Discord Hub")
              .setEmoji("💬")
              .setURL("[https://discord.goldendev.net](https://discord.goldendev.net)"),
            new V2ButtonBuilder()
              .setStyle(ButtonStyle.Link)
              .setLabel("Watch Tutorials on YouTube")
              .setEmoji("📺")
              .setURL("[https://youtube.goldendev.net](https://youtube.goldendev.net)")
          )
      )
  );

channel.send(message);