AurumButton

Aurum's primary button component — the SwiftUI port of aurum-android's AurumButton.

familyButtons
platformiOS 17+ · SwiftUI
figmacomponent master ↗
sourceSources/Aurum/Component/Button/AurumButton.swift
code connectFigmaConnect/Sources/AurumFigmaConnect/AurumButton.figma.swift
snapshots6 baselines · iPhone 17 Pro · iOS 26.5

Aurum's primary button component — the SwiftUI port of aurum-android's AurumButton.

A custom primitive (Button + a private ButtonStyle for configuration.isPressed) — not a restyled system button — so every state matches the Figma component exactly and bespoke interactions (the dimensional hard-shadow press) are unconstrained. Features consume this view for any button.

Three visual variant variants (AurumButtonVariant) and three size variants (AurumButtonSize) are supported. Optional leading and trailing slots accept icon views for icon-and-label buttons; slot content picks up the button's foreground via \.aurumContentColor.

Platform notes vs Android: the ripple's place is taken by a 12% content-colour press overlay (except the dimensional full-width primary, whose press cue is purely the shadow drop + 2 pt sink); the minimum touch target reserves 44 pt (HIG) rather than Android's 48 dp.

Intended use

Use when the user is performing a deliberate, named action (submit, confirm, continue, retry). One .primary per surface — pair Primary with Secondary or Tertiary for additional actions.

Do

  • Use one .primary per screen for the dominant CTA.
  • Choose .medium as the default; .large only for full-width hero CTAs; .small for inline / compact rows.
  • Set isLoading: true synchronously when the action starts a network round-trip — don't render a separate spinner alongside.
  • Drive progress from a countdown for an auto-advancing CTA — the fill mirrors the time left before the action fires on its own.

Don’t

  • Stack two .primary buttons next to each other — pair Primary with Secondary.
  • Use a button to navigate without a side-effect; use a plain tap target instead.
  • Apply .frame(maxWidth: .infinity) yourself — use isFullWidth: true so the Aurum padding / touch-target rules apply.

Snapshots

Recorded on the pinned simulator — iPhone 17 Pro · iOS 26.5 · Xcode 26.6.

AurumButton — BannerToastSnapshotTests · testIconButton
BannerToastSnapshotTests · testIconButton
AurumButton — ComponentSnapshotTests · testButtonPrimaryStates
ComponentSnapshotTests · testButtonPrimaryStates
AurumButton — ComponentSnapshotTests · testButtonProgress
ComponentSnapshotTests · testButtonProgress
AurumButton — ComponentSnapshotTests · testButtonSecondaryTertiaryStates
ComponentSnapshotTests · testButtonSecondaryTertiaryStates
AurumButton — ComponentSnapshotTests · testButtonSizes
ComponentSnapshotTests · testButtonSizes
AurumButton — ComponentWave2SnapshotTests · testLinkButton
ComponentWave2SnapshotTests · testLinkButton

Code Connect

Mapped to Figma node 4692:1074 ↗ — SwiftUI snippets appear in Dev Mode for the latest release.