PathLogs UI
Русский

Components

Button

A button with variants, sizes and a loading state.

A button with style variants, sizes, an icon and a loading state. Everything else is ordinary <button> attributes.

Variants

Sizes

Loading

loading shows a spinner, disables the button and sets aria-busy. It is worth switching the caption to a continuous form while it runs — «Saving» rather than «Save»:

The spinner inherits the text colour, so it reads equally well on every variant — it needs no colour of its own.

Props

variant"primary" | "secondary" | "ghost" | "danger" | "gradient"

defaults to: "secondary"

The styling.

size"sm" | "md" | "lg"

defaults to: "md"

The size.

loadingboolean

defaults to: false

A spinner in place of the icon; the button is disabled.

iconReactNode

An icon to the left of the caption.

blockboolean

defaults to: false

Fill the container's full width.

ButtonHTMLAttributes

Everything else goes to <button>: onClick, disabled, form, aria-*.

The component forwards ref — you can focus it programmatically or feed it into your own positioning logic.