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> & { /** Fruit-colour treatment. The label remains on an optically stable layer. */ variant?: GummyButtonVariant; /** Preserves a 44px minimum touch target at every visual size. */ size?: GummyButtonSize; /** Controls optical transmission without changing semantic colour. */ finish?: GummyButtonFinish; /** Disables activation, exposes busy state, and shows a non-motion-dependent cue. */ loading?: boolean; /** Visible label while loading. */ loadingText?: React.ReactNode; }

Troubleshooting

Check behavior before surface.

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

Resize the canvas, switch its theme, or reverse its reading direction without changing the rest of the page.

Width
Theme
Direction

Button preview: fluid width, light theme, left to right.

Editable source

Read before you install

Canonical Base UI or native source

Loading editable source…