Forms and selection · stable · MIT

Button

The approved fruit-gel action with chewy press physics.

Install editable source

Add Button

Base UI / canonicalnpx shadcn@latest add https://gummyui.dev/r/gummy-button.json

No package dependency beyond React. Shared Gummy material is resolved automatically.

Behavior contract

Semantics before surface

Semantics

A native button with variant, size, finish, loading, and disabled states.

Keyboard

Enter and Space activate the native button.

System support

Light and dark themes, logical RTL layout, reduced motion, responsive content, and forwarded public refs.

Source-derived reference

Anatomy and public API

Exported anatomy

These public React parts are read directly from the canonical source during the documentation build.

  • GummyButton

Prop contracts

GummyButtonProps

Composes React.ButtonHTMLAttributes<HTMLButtonElement> & { variant?: GummyButtonVariant; size?: GummyButtonSize; finish?: GummyButtonFinish; loading?: boolean; loadingText?: React.ReactNode; }

Troubleshooting

Check behavior before surface.

Implementation decisions

When to use Button

Use a button for an action that changes state, submits data, opens a control, or starts a process; use a link when the result is navigation. Keep the visible label specific to the outcome and preserve native disabled, focus, keyboard, and form behavior. Loading feedback should name the ongoing work without erasing the original context. Test double activation, server rejection, destructive confirmation, permission changes, touch targets, high zoom, and completion announcements.

Live product source

Inspect the canonical states

The Component Lab exercises real source across default, focus, disabled, responsive, dark, reduced-motion, and RTL contexts.

Open the live Component Lab

Interactive inspection

Try Button in context

Load the real component preview when you are ready to interact with its responsive, theme, and direction controls.

Editable source

Read before you install

Canonical Base UI or native source

The registry payload stays off the initial page request.