ArtificialSenseDocs

Docs / Components

SenseButtonComponent

Primary action control from @artificialsenselabs/ui โ€” composes sense-icon, sense-spinner, and sense-badge internally.

Live demo: run nx serve showcase and open /components/button (port 4202).

Overview

Category: Form / actions. Selector: sense-button. Import: import { SenseButtonComponent } from '@artificialsenselabs/ui';

<sense-button severity="primary" icon="search" [loading]="saving()" (clicked)="save()">
  Save
</sense-button>

API

Generated from libs/ui/src/lib/button/sense-button/sense-button.component.ts โ€” run pnpm run docs:api to refresh.

Inputs
InputTypeDefaultDescription
labelstring | nullnull Visible label when not using projection alone.
typeSenseButtonType'button' Native button `type` attribute.
variantSenseSurfaceVariant | nullnull Preferred surface treatment (`filled`, `outlined`, `ghost`). Overrides `appearance` when set.
appearancedeprecatedSenseButtonAppearance'solid' Visual style โ€” solid, outline, ghost, or link. Deprecated: Prefer `variant`.
severitySenseButtonSeverity'primary' Semantic colour role.
sizeSenseButtonSize'md' Button scale token.
iconSenseIconName | nullnull Optional leading/trailing icon glyph.
iconPositionSenseButtonIconPosition'left' Icon placement when `icon` is set.
iconOnlybooleanfalse Square icon-only layout โ€” requires `ariaLabel`.
loadingbooleanfalse Shows spinner, sets `aria-busy`, and disables interaction.
disabledbooleanfalse Disables the native button.
fullWidthbooleanfalse Stretches to container width.
pillbooleanfalse Pill border radius.
badgestring | number | nullnull Overlay badge count via `sense-badge`.
badgeColorSenseBadgeSeverity'danger' Badge colour passed to `sense-badge`.
ariaLabelstring | nullnull Accessible name override for icon-only or custom labelling.
loadingLabelstring | nullnull Accessible name while `loading` is true; falls back to i18n `button.loading`.
pressedboolean | undefinedundefined Toggle/segmented state forwarded as `aria-pressed` on the native button. Leave unset on plain action buttons so the attribute is omitted.
Outputs
OutputTypeDescription
clickedMouseEventEmitted when the native button is clicked and not disabled/loading.

Accessibility

  • ARIA attributes live on the native <button>, not the host.
  • loading sets aria-busy="true" and disables interaction.
  • iconOnly requires ariaLabel (i18n fallback: button.iconOnly).
  • Bind pressed only for toggle/segmented controls (e.g. tab groups).