Theme
Install with your agentnpx shadcn@4.23.1 add @goop/trail-button

Button

Free

A button with words that runs an action, in several looks and sizes, for React and Tailwind CSS. Free, MIT.

Switch every look, shape and size; change the words; add the icon; make it disabled or busy. Press it (pointer or keyboard) and the count under it goes up, but never while disabled or busy (busy keeps its width and the focus). Nothing is saved: the press is only counted.

When to use

  • A button with words that runs an action, in several looks and sizes.

When not to use

Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Button on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing.

Terminal
npx shadcn@4.23.1 add @goop/trail-button
PROMPT
Add the Goop Button to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { Button, ButtonIcon, ButtonLabel, ButtonEnd } from '@/components/ui/goop/button';
import { useState } from 'react';

function NoteActions({ save }: { save?: () => Promise<void> }) {
  const [saving, setSaving] = useState(false);
  return (
    <>
      <Button variant="ghost" size="md">
        <ButtonIcon icon="plus" />
        <ButtonLabel>Add</ButtonLabel>
      </Button>
      {/* the main action: 28 px on a wide screen, 48 px on a phone */}
      <Button
        loading={saving}
        loadingLabel="Saving"
        onClick={async () => {
          setSaving(true);
          try {
            await save?.();
          } finally {
            setSaving(false);
          }
        }}
      >
        Save
      </Button>
    </>
  );
}
  • Fits: account, app, board, chat, flow, list, record, schedule, states (their recipes).
  • height, width, padding, gap, corner, border, background, shadow, text, motion: add no class for these.

API reference

Options
OptionTypeWhat it does
variantprimary | outline | ghost | subtle | link | nav | text = primary
shapepill | rounded = pill
sizesm | md | lg | xl = md
asChild?boolean = falseRender the button's look on the one child element instead of a button (a link, a menu's trigger).
loading?boolean = falseThe button's action is running: a spinner over its words (the width kept), and no press reaches onClick or submits; it keeps the focus.
loadingLabel?string = 'Loading'What a reader hears beside the button's words while loading.
type?'button' | 'submit' | 'reset'
onClick?(event: MouseEvent) => void
disabled?boolean
Parts
PartWhat it is
ButtonIconA glyph in the button; icon: IconName — A pack icon name
ButtonLabelThe button's words, where they carry a type of their own (the quiet rounded button's 450 weight, a sort control's grey words); words without it sit in the button directly
ButtonEndThe button's trailing run — a glyph after the words (a sort arrow, an outward arrow) or a key hint
  • Class recipes (cva): buttonVariants (Button)
  • data-slot values (to select a part by): button, button-end, button-icon, button-label, button-spinner

Keyboard

KeyWhat it does
EnterActivate
SpaceActivate

Accessibility

  • The native element answers the keyboard.
  • hover, active, focus-visible: the browser's own (:hover, :active, :focus-visible): write nothing

Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:

StateDrawn by
expandedthe attribute data-state=open
openthe attribute data-state=open
disabledthe prop disabled

Motion

  • The part sets its own motion: add no transition or animation of your own.
  • How the theme moves, and how to move your own parts the same way: Motion.

Responsive behaviour

  • The button is as wide as its words wherever it stands; no parent or prop stretches it. One that fills its row takes className="w-full"; one that fills it on a phone only, className="max-narrow:w-full".

Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

goop.so/themes/trail/components/button.md · the page as Markdown

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.