Actions

Button

@xui/button

A clickable action. A directive rather than a component, so it styles a real <button> or <a> and keeps their semantics — including disabled, form submission and link navigation.

Install

pnpm add @xui/button

Add the barrel to a standalone component's imports:

import { XuiButtonImports } from '@xui/button';

@Component({
  imports: [XuiButtonImports],
  // …
})

Examples

Default

Loading preview…

Dash

Loading preview…

Outline

Loading preview…

Ghost

Loading preview…

Small

Loading preview…

Large

Loading preview…

Colors

Loading preview…

Disabled

Loading preview…

Loading

Loading preview…

Active

Loading preview…

Fill and align

Loading preview…

Anchor

Loading preview…

API

XuiButton

directive[xuiButton]

Turns a native <button> or <a> into an xUI button.

Variants

AxisOptionsDefaultvariantdefaultdashoutlineghostlinkdefaultsizesmmdlgmdcolorprimarysecondarysuccesserrorinfowarningprimary

Inputs

NameTypeDefaultcolorXuiButtonVariants['color']Intent colour. Pairs with variant to pick the concrete palette.this.config.colorsizeXuiButtonVariants['size']Control height, from the shared control scale. The gap and icon size scale with it.this.config.sizevariantXuiButtonVariants['variant']How much the button asserts itself, from a filled default down to a bare link.this.config.variantclassClassValueExtra classes, merged into the directive's own rather than replacing them.''fillbooleanStretch to fill the available width instead of hugging its contents.falsealignTextXuiButtonAlignAlignment of the label/icons along the main axis. Defaults to centred.'center'activebooleanRender a pressed/selected appearance (also sets aria-pressed).falseloadingbooleanSwap the contents for a centred spinner while keeping the button's width, and block interaction. The label stays laid out (hidden) so the button never jumps.false

Methods

setClass(classes: ClassValue): void

Source

libs/ui/button/xui

xUI 2.0.0 — Apache 2.0 licensed. Built with Angular and Tailwind CSS.