• CMSnpm version

    • Overview
    • ContentBuilder
    • InviteUserForm
    • LoginForm
    • RenewPasswordForm
  • UInpm version

    • Overview
    • Accordion
    • AlertBubble
    • AnnouncementBar
    • Avatar
    • AvatarFileInput
    • Badge
    • Button
    • ButtonGroup
    • ButtonList
    • Calendar
    • Checkbox
    • CheckboxButton
    • CheckboxInput
    • CheckboxList
    • Chip
    • ColorRadio
    • ColorRadioGroup
    • Combobox
    • DatePicker
    • DatePickerInput
    • DateRangePicker
    • DateRangePickerInput
    • DatetimePicker
    • DatetimePickerInput
    • Dialog
    • Dropdown
    • Dropzone
    • ErrorMessage
    • FileInput
    • FlashMessages
    • FormComponent
    • Icon
    • IconButton
    • ImageGallery
    • InfoBox
    • Input
    • Label
    • Layout
    • Lightbox
    • ListItem
    • Loader
    • Lozenge
    • Menu
    • Message
    • Modal
    • ✅ ModalDialog
    • ✅ ModalHeader
    • MultiCombobox
    • MultiSelect
    • Pagination
    • Paper
    • Popover
    • Radio
    • RadioGroup
    • RasterImage
    • Select
    • ✅ Tabs
    • TextInput
    • TextLink
    • Textarea
    • TimePicker
    • TimePickerInput
    • Toggle
    • Tooltip
    • Typography
  • Formnpm version

    • Overview
    • AvatarFileInput
    • CheckboxButton
    • CheckboxInput
    • CheckboxList
    • ColorRadioGroup
    • Combobox
    • DatePickerInput
    • DateRangePickerInput
    • DatetimePickerInput
    • Dropzone
    • FileInput
    • Form
    • FormRenderer
    • GpsInput
    • MoneyInput
    • MultiCombobox
    • MultiSelect
    • NumberInput
    • PasswordInput
    • RadioGroup
    • Select
    • TextInput
    • Textarea
    • TimePickerInput
    • Toggle
  • DataGridnpm version

    • Overview
    • DataGrid
    • DataGridCustomExample
    • ExportButton
    • FilterList
    • Filters
    • FiltersButton
    • FulltextInput
    • HiddenColumns
    • HiddenColumnsButton
    • Pagination
    • RowCounts
    • RowsPerPageSelect
    • SelectedRowsToolbar
    • TableV2
    • ToolbarControl
    • ToolbarCustoms
    • ToolbarTabs
  • Wysiwygnpm version

    • Overview
  • Resizernpm version

    • Overview
  • Routernpm version

    • Overview
  • Corenpm version

    • Overview
  • Core-Reactnpm version

    • Overview
  • Stylesnpm version

    • Overview
  • Localizenpm version

    • Overview
  • Analyticsnpm version

    • Overview
  • Datepickernpm version

    • Overview
  • Icons-generatornpm version

    • Overview
  • Smart-addressnpm version

    • Overview
  • E2Enpm version

    • Overview
  • E2E-Playwrightnpm version

    • Overview
View source on GitLab

Button

Clickable action/link control. Renders as an anchor (<a>) by default, or as a Next.js Link via the as prop.

When to use

Use Button for any primary action or navigation target. It is anchor-based, so it works both as a button (with onClick / type="submit") and as a link (with href).

  • Icon-only buttons: use IconButton instead — the isIconButton prop here is deprecated.
  • Groups of buttons: see ButtonGroup and ButtonList.

There is no @uxf/form twin — Button is not a form field, it is a standalone control.

Usage

import { Button } from "@uxf/ui/button";

// action
<Button onClick={handleSave}>Save</Button>

// link (server-rendered anchor)
<Button href="/pricing">Pricing</Button>

// client-side navigation via Next.js Link
import Link from "next/link";
<Button as={Link} href="/dashboard">Dashboard</Button>

// form submit
<Button type="submit">Submit</Button>

Props

Extends AnchorHTMLAttributes<HTMLAnchorElement> (minus type), so all standard <a> attributes (href, target, rel, download, onClick, className, children, …) are accepted.

Prop Type Default Description
variant ButtonVariant "default" Visual style.
color ButtonColor "default" Color scheme.
size ButtonSize "default" Size.
isFullWidth boolean false Stretch to the full width of the container.
isDisabled boolean false Non-interactive state (sets aria-disabled, removes it from tab order).
isLoading boolean false Busy state (sets aria-busy, shows a spinner).
type "submit" — Submits the closest <form> on activation. This is the only accepted type.
as "a" | NextLink "a" Element to render. Pass Next.js Link for client-side navigation.
analyticsCallback () => void — Called when the button is activated (before onClick).
isIconButton boolean false Deprecated — use IconButton.

Variants & states

Built-in values (from theme.ts):

Group Values
variant default, secondary, text
size sm, default, lg, xl
color default, positive, negative, warning, info, inverted

These sets are open interfaces (ButtonVariants, ButtonSizes, ButtonColors). A project can add its own values via module augmentation:

// button.d.ts
declare module "@uxf/ui/button/theme" {
    interface ButtonVariants {
        cta: true;
    }
}

Behavioural states:

  • Loading: set isLoading, or return a Promise from onClick — the button automatically enters the busy state until the promise settles.

    <Button onClick={() => new Promise((resolve) => setTimeout(resolve, 1000))}>Save</Button>
    
  • Disabled: set isDisabled. Clicks and keyboard activation are blocked and the control leaves the tab order.

  • Links: when href and target="_blank" are set, rel="noopener noreferrer" is added automatically.

Requirements

Import the component stylesheet once in your global CSS:

@import url("@uxf/ui/css/button.css");

Also requires the global @uxf/ui token layer, set up once per app — see @uxf/ui setup.

Links

  • Figma
Basic
Open in new tab
Default
Open in new tab
LoadingButton
Open in new tab
OnlyForE2ETests
Open in new tab