Problem
Three issues in the Button component affect the loading indicator, icon-only usage, and the destructive variant context.
1. Button loading spinner replaces the button label text — users lose context
When loading={true}, the spinner renders and children still render beside it. But if the button label is short (e.g. "Send"), the spinner + "Send" layout shifts the text. A pattern where the spinner overlays the icon position and the label remains visible (like GitHub's buttons) would be less disorienting.
2. No icon-only Button variant or size modifier
Button has no iconOnly prop that removes horizontal padding and makes the button square. Icon-only buttons (like the FeeEstimator refresh button) use raw <button> elements with custom classes instead of the Button primitive, leading to inconsistent focus styles and hover states.
3. destructive variant has no confirm UX pattern built in
The destructive variant is used for dangerous actions (delete, reset). There is no built-in optional two-step confirmation (like the disconnect button proposal in issue #18). An onClickConfirm pattern where the button switches to "Are you sure?" on first click would standardise dangerous action patterns.
Solution
- Change the loading state to render the spinner in place of a leading icon slot, keeping the label visible.
- Add
iconOnly?: boolean prop that applies aspect-square and removes horizontal padding.
- Add
requireConfirm?: boolean and confirmLabel?: string props to Button that trigger the two-click pattern.
Acceptance Criteria
Note for Contributors: Write a clear PR description. Include before/after screenshots of the loading state and the icon-only button variant.
Problem
Three issues in the
Buttoncomponent affect the loading indicator, icon-only usage, and thedestructivevariant context.1.
Buttonloading spinner replaces the button label text — users lose contextWhen
loading={true}, the spinner renders and children still render beside it. But if the button label is short (e.g. "Send"), the spinner + "Send" layout shifts the text. A pattern where the spinner overlays the icon position and the label remains visible (like GitHub's buttons) would be less disorienting.2. No icon-only
Buttonvariant or size modifierButtonhas noiconOnlyprop that removes horizontal padding and makes the button square. Icon-only buttons (like theFeeEstimatorrefresh button) use raw<button>elements with custom classes instead of theButtonprimitive, leading to inconsistent focus styles and hover states.3.
destructivevariant has noconfirmUX pattern built inThe destructive variant is used for dangerous actions (delete, reset). There is no built-in optional two-step confirmation (like the disconnect button proposal in issue #18). An
onClickConfirmpattern where the button switches to "Are you sure?" on first click would standardise dangerous action patterns.Solution
iconOnly?: booleanprop that appliesaspect-squareand removes horizontal padding.requireConfirm?: booleanandconfirmLabel?: stringprops toButtonthat trigger the two-click pattern.Acceptance Criteria
iconOnlyprop makes button square with no horizontal paddingrequireConfirmtriggers two-click confirmation patternnpm run buildandtsc --noEmitpass