Skip to content

UButton: centered loading spinner #5362

@rijenkii

Description

@rijenkii

Package

v4.x

Description

Currently UButton only allows for two automatically-selected spinner positions on the button:

  • at the start of the button (used when there is no trailing icon on the button)
  • at the end of the button (used when there is a trailing icon on the button)

#3419 (closed as stale) had a suggestion to add a loadingPosition prop that would allow for the spinner to be placed at the start or end of the button independently of the icons (e.g. placing the spinner at the end of the button when leading icon is present).

I propose an extension of that suggestion by also adding center to the proposed loadingPosition prop. The resulting button would look and work something like this: Playground

Screencast.From.2025-11-01.22-30-22.webm

No width-jumping when button has no icons is the main reason I like this spinner position more than what is available today.

I might be able to provide a PR, but only closer to the end of the year.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttriageAwaiting initial review and prioritizationv4#4488

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions