grasscnGitHub

Button Group

Related actions composed from Minecraft buttons and labels.

Preview

Unsaved
Loading example...
To run this copied example, install these items using the linked CLI or manual instructions:

Usage

ButtonGroup defaults to horizontal orientation and supplies role="group". Give the group a purpose-specific accessible name. ButtonGroupText uses the inherited scale with optional logical maxWidth and align. ButtonGroupSeparator defaults to vertical, unlike the standalone Separator component.

Composition

Use ButtonGroupText for the current action result and separators only between related actions. Vertical groups are supported layouts, but a rotated vertical separator is a web adaptation. Install Button alongside the group rather than expecting the group export to create action buttons.

Installation

Loading registry address

Component source

This is the component implementation. Its supporting styles, helpers and resources are also required. See complete manual installation.

Component implementationcomponents/ui/button-group.tsx · tsx
"use client";

import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
import { cva } from "class-variance-authority";
import type { VariantProps } from "class-variance-authority";
import * as React from "react";

import { MinecraftDisclosureText } from "./minecraft-disclosure-text";
import {
  minecraftClasses as cn,
  minecraftStyle,
  MinecraftRender,

Interactive playground

World actions
Readyhorizontal grouping