# Button

Buttons start actions. Use one orange Primary per view for the main action, Secondary for everything alongside it, and Ink when a dark button suits the moment better.

Category: Base. Docs: http://localhost:3800/docs/components/button

## When to use

- Primary for the one action the view exists for: Save, Create, Continue.
- Secondary for the actions beside it, Tertiary for quiet ones in toolbars and dialogs.
- Danger only for the confirming button of something that can't be undone.
- Link inside sentences or for navigation that should read as text.

## Avoid

- Two Primary buttons in one view.
- Labels longer than three words, or Title Case: buttons are short verbs in sentence case.
- S buttons on touch screens: use L for mobile, sign-in and checkout.

## Motion

- Pressing sinks the button to 97% with an ease-out; it eases back when you let go.
- Loading never changes the width: the spinner crossfades into the leading icon's place, or fades in over a label that fades out where it stands.
- A loading button keeps its colour and ignores clicks instead of turning grey.
- Colours and the focus ring change in 120 ms, so hover feels instant while movement feels physical.

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| variant | `"primary" \| "secondary" \| "tertiary" \| "ink" \| "danger" \| "link" \| "link-subtle"` | "primary" | Visual weight. One primary per view. |
| size | `"s" \| "m" \| "l" \| "xl" \| "xxl"` | "m" | 32, 40, 48, 56 or 64 pixels high. M on desktop, L for touch. |
| leadingIcon | `ReactNode` |  | Icon before the label. Also the icon of an iconOnly button. |
| trailingIcon | `ReactNode` |  | Icon after the label, usually a chevron or arrow. |
| loading | `boolean` | false | Shows a spinner in place of the leading icon and disables the button. |
| iconOnly | `boolean` | false | Square button showing only leadingIcon. Give it an aria-label. |
| fullWidth | `boolean` | false | Stretches to its container, for stacked mobile actions. |
| shape | `"rounded" \| "pill"` | "rounded" | Pill rounds the ends fully. Pill button and Round icon button are built on it. |
| href | `string` |  | Renders an <a> with the same styles. |

## Install

Requires the Ochre theme (`@ochre/ochre-theme`: ochre.css, ochre-tailwind.css and ochre-motion.css, imported after tailwindcss).

```bash
npx shadcn@latest add @ochre/button
```

It imports these Ochre files too: `components/ochre/utils`.

npm packages (React): lucide-react.

## React: `components/ochre/button.tsx`

```tsx
"use client";

import * as React from "react";
import { cx } from "@/components/ochre/utils";

export type ButtonVariant = "primary" | "secondary" | "tertiary" | "ink" | "danger" | "link" | "link-subtle";
export type ButtonSize = "s" | "m" | "l" | "xl" | "xxl";
export type ButtonShape = "rounded" | "pill";

type Common = {
  variant?: ButtonVariant;
  size?: ButtonSize;
  leadingIcon?: React.ReactNode;
  trailingIcon?: React.ReactNode;
  loading?: boolean;
  iconOnly?: boolean;
  fullWidth?: boolean;
  // Pill rounds the ends fully: Pill button, and Round icon button with iconOnly.
  shape?: ButtonShape;
};

export type ButtonProps = Common &
  (
    | (React.ButtonHTMLAttributes<HTMLButtonElement> & { href?: undefined })
    | (React.AnchorHTMLAttributes<HTMLAnchorElement> & { href: string })
  );

// One ladder for every control: S 32, M 40 (desktop default), L 48 (touch), XL 56, XXL 64.
// Exported so the other buttons (toggle, shortcut, count, button group) sit on exactly the same ladder.
export const buttonSizes: Record<ButtonSize, string> = {
  s: "h-8 gap-1.5 px-3 text-[13px] leading-[18px] [&_svg]:size-3.5",
  m: "h-10 gap-2 px-3.5 text-[14px] leading-5 [&_svg]:size-4",
  l: "h-12 gap-2 px-4 text-[16px] leading-6 [&_svg]:size-[18px]",
  xl: "h-14 gap-2.5 px-5 text-[18px] leading-7 [&_svg]:size-5",
  xxl: "h-16 gap-3 px-6 text-[20px] leading-7 [&_svg]:size-6",
};

export const buttonRadii: Record<ButtonSize, string> = {
  s: "rounded-8",
  m: "rounded-10",
  l: "rounded-12",
  xl: "rounded-12",
  xxl: "rounded-16",
};

export const buttonIconOnlySizes: Record<ButtonSize, string> = {
  s: "w-8 px-0",
  m: "w-10 px-0",
  l: "w-12 px-0",
  xl: "w-14 px-0",
  xxl: "w-16 px-0",
};

const variants: Record<ButtonVariant, string> = {
  primary: "bg-action-primary text-action-on-primary shadow-xs hover:bg-action-primary-hover",
  secondary:
    "border border-border-default bg-surface-card text-action-on-secondary shadow-xs hover:border-border-hover hover:bg-action-secondary-hover",
  tertiary: "text-text-default hover:bg-state-hover active:bg-state-pressed",
  ink: "bg-action-ink text-action-on-ink shadow-xs hover:bg-action-ink-hover",
  danger: "bg-action-danger text-action-on-danger shadow-xs hover:bg-action-danger-hover focus-visible:shadow-focus-danger",
  link: "!h-auto !px-0 text-text-accent underline-offset-4 hover:text-text-accent-hover hover:underline",
  "link-subtle": "!h-auto !px-0 text-text-muted underline-offset-4 hover:text-text-default hover:underline",
};

export function Button(props: ButtonProps) {
  const {
    variant = "primary",
    size = "m",
    leadingIcon,
    trailingIcon,
    loading = false,
    iconOnly = false,
    fullWidth = false,
    shape = "rounded",
    className,
    children,
    ...rest
  } = props;

  const isLink = variant === "link" || variant === "link-subtle";
  const classes = cx(
    "relative inline-flex shrink-0 select-none items-center justify-center whitespace-nowrap font-medium",
    // Colours change quickly; the press rides the snappy spring and springs back on release.
    "transition-ui outline-none focus-visible:shadow-focus",
    !isLink && "press",
    "disabled:pointer-events-none disabled:border-transparent disabled:bg-action-disabled disabled:text-action-on-disabled disabled:shadow-none",
    "aria-disabled:pointer-events-none [&[aria-disabled=true]:not([data-loading])]:opacity-50",
    "data-[loading=true]:pointer-events-none",
    buttonSizes[size],
    shape === "pill" ? "rounded-full" : buttonRadii[size],
    iconOnly && buttonIconOnlySizes[size],
    variants[variant],
    isLink && "disabled:bg-transparent",
    fullWidth && "w-full",
    className,
  );

  // Loading never changes the width. With a leading icon, the spinner crossfades into its place;
  // without one, the label fades out where it stands and the spinner fades in over it.
  const fade = "transition-[opacity,scale] duration-[var(--motion-base)] ease-[var(--motion-ease-out)]";
  const overlay = loading && !leadingIcon;
  const content = (
    <>
      {leadingIcon ? (
        <span className="grid shrink-0 place-items-center [&>*]:col-start-1 [&>*]:row-start-1">
          <span className={cx("inline-flex", fade, loading ? "scale-50 opacity-0" : "scale-100 opacity-100")}>{leadingIcon}</span>
          {loading ? (
            <span className={cx("inline-flex", fade, "starting:scale-50 starting:opacity-0")}>
              <Spinner />
            </span>
          ) : null}
        </span>
      ) : null}
      {!iconOnly && children != null && (
        <span className={cx("truncate", fade, overlay ? "opacity-0" : "opacity-100")}>{children}</span>
      )}
      {!iconOnly && trailingIcon ? (
        <span className={cx("inline-flex shrink-0", fade, overlay ? "opacity-0" : "opacity-100")}>{trailingIcon}</span>
      ) : null}
      {overlay ? (
        <span className={cx("absolute inset-0 grid place-items-center", fade, "starting:scale-50 starting:opacity-0")}>
          <Spinner />
        </span>
      ) : null}
    </>
  );

  if ("href" in rest && rest.href !== undefined) {
    const anchor = rest as React.AnchorHTMLAttributes<HTMLAnchorElement>;
    return (
      <a {...anchor} className={classes} aria-busy={loading || undefined} data-loading={loading || undefined}>
        {content}
      </a>
    );
  }

  const button = rest as React.ButtonHTMLAttributes<HTMLButtonElement>;
  return (
    <button
      type="button"
      {...button}
      // A loading button keeps its colour and ignores clicks, rather than turning grey.
      aria-disabled={loading || button["aria-disabled"] || undefined}
      onClick={loading ? (e) => e.preventDefault() : button.onClick}
      aria-busy={loading || undefined}
      data-loading={loading || undefined}
      className={classes}
    >
      {content}
    </button>
  );
}

function Spinner() {
  return (
    <svg viewBox="0 0 24 24" fill="none" aria-hidden="true" className="animate-spin">
      <circle cx="12" cy="12" r="9" stroke="currentColor" strokeOpacity="0.25" strokeWidth="2.5" />
      <path d="M21 12a9 9 0 0 0-9-9" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" />
    </svg>
  );
}
```

## Vue 3: `components/ochre/Button.vue`

```vue
<script setup lang="ts">
import { computed, useSlots } from "vue";

type Variant = "primary" | "secondary" | "tertiary" | "ink" | "danger" | "link" | "link-subtle";
type Size = "s" | "m" | "l" | "xl" | "xxl";
// Pill rounds the ends fully: Pill button, and Round icon button with iconOnly.
type Shape = "rounded" | "pill";

const props = withDefaults(
  defineProps<{
    variant?: Variant;
    size?: Size;
    loading?: boolean;
    iconOnly?: boolean;
    fullWidth?: boolean;
    shape?: Shape;
    disabled?: boolean;
    href?: string;
    type?: "button" | "submit" | "reset";
  }>(),
  { variant: "primary", size: "m", shape: "rounded", type: "button" },
);

// One ladder for every control: S 32, M 40 (desktop default), L 48 (touch), XL 56, XXL 64.
const sizes: Record<Size, string> = {
  s: "h-8 gap-1.5 px-3 text-[13px] leading-[18px] [&_svg]:size-3.5",
  m: "h-10 gap-2 px-3.5 text-[14px] leading-5 [&_svg]:size-4",
  l: "h-12 gap-2 px-4 text-[16px] leading-6 [&_svg]:size-[18px]",
  xl: "h-14 gap-2.5 px-5 text-[18px] leading-7 [&_svg]:size-5",
  xxl: "h-16 gap-3 px-6 text-[20px] leading-7 [&_svg]:size-6",
};
const radii: Record<Size, string> = { s: "rounded-8", m: "rounded-10", l: "rounded-12", xl: "rounded-12", xxl: "rounded-16" };
const iconOnlySizes: Record<Size, string> = { s: "w-8 px-0", m: "w-10 px-0", l: "w-12 px-0", xl: "w-14 px-0", xxl: "w-16 px-0" };
const variants: Record<Variant, string> = {
  primary: "bg-action-primary text-action-on-primary shadow-xs hover:bg-action-primary-hover",
  secondary:
    "border border-border-default bg-surface-card text-action-on-secondary shadow-xs hover:border-border-hover hover:bg-action-secondary-hover",
  tertiary: "text-text-default hover:bg-state-hover active:bg-state-pressed",
  ink: "bg-action-ink text-action-on-ink shadow-xs hover:bg-action-ink-hover",
  danger: "bg-action-danger text-action-on-danger shadow-xs hover:bg-action-danger-hover focus-visible:shadow-focus-danger",
  link: "!h-auto !px-0 text-text-accent underline-offset-4 hover:text-text-accent-hover hover:underline",
  "link-subtle": "!h-auto !px-0 text-text-muted underline-offset-4 hover:text-text-default hover:underline",
};

const slots = useSlots();
const fade = "transition-[opacity,scale] duration-[var(--motion-base)] ease-[var(--motion-ease-out)]";
const overlay = computed(() => props.loading && !slots.leading);

const classes = computed(() =>
  [
    "relative inline-flex shrink-0 select-none items-center justify-center whitespace-nowrap font-medium",
    // Colours change quickly; the press rides the snappy spring and springs back on release.
    "transition-ui outline-none focus-visible:shadow-focus",
    !(props.variant === "link" || props.variant === "link-subtle") && "press",
    "disabled:pointer-events-none disabled:border-transparent disabled:bg-action-disabled disabled:text-action-on-disabled disabled:shadow-none",
    "data-[loading=true]:pointer-events-none",
    sizes[props.size],
    props.shape === "pill" ? "rounded-full" : radii[props.size],
    props.iconOnly && iconOnlySizes[props.size],
    variants[props.variant],
    (props.variant === "link" || props.variant === "link-subtle") && "disabled:bg-transparent",
    props.fullWidth && "w-full",
  ]
    .filter(Boolean)
    .join(" "),
);
</script>

<template>
  <!-- Loading never changes the width: the spinner crossfades into the leading icon's place,
       or, with no icon, the label fades out where it stands and the spinner fades in over it. -->
  <component
    :is="href ? 'a' : 'button'"
    :href="href"
    :type="href ? undefined : type"
    :disabled="href ? undefined : disabled"
    :aria-disabled="loading || undefined"
    :aria-busy="loading || undefined"
    :data-loading="loading || undefined"
    :class="classes"
    @click="loading && $event.preventDefault()"
  >
    <span v-if="$slots.leading" class="grid shrink-0 place-items-center [&>*]:col-start-1 [&>*]:row-start-1">
      <span :class="['inline-flex', fade, loading ? 'scale-50 opacity-0' : 'scale-100 opacity-100']"><slot name="leading" /></span>
      <span v-if="loading" :class="['inline-flex', fade, 'starting:scale-50 starting:opacity-0']">
        <svg viewBox="0 0 24 24" fill="none" aria-hidden="true" class="animate-spin">
          <circle cx="12" cy="12" r="9" stroke="currentColor" stroke-opacity="0.25" stroke-width="2.5" />
          <path d="M21 12a9 9 0 0 0-9-9" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" />
        </svg>
      </span>
    </span>
    <span v-if="!iconOnly && $slots.default" :class="['truncate', fade, overlay ? 'opacity-0' : 'opacity-100']"><slot /></span>
    <span v-if="!iconOnly && $slots.trailing" :class="['inline-flex shrink-0', fade, overlay ? 'opacity-0' : 'opacity-100']"><slot name="trailing" /></span>
    <span v-if="overlay" :class="['absolute inset-0 grid place-items-center', fade, 'starting:scale-50 starting:opacity-0']">
      <svg viewBox="0 0 24 24" fill="none" aria-hidden="true" class="animate-spin">
        <circle cx="12" cy="12" r="9" stroke="currentColor" stroke-opacity="0.25" stroke-width="2.5" />
        <path d="M21 12a9 9 0 0 0-9-9" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" />
      </svg>
    </span>
  </component>
</template>
```

## HTML: `button.html`

```html
<!-- Ochre button. Needs ochre.css, ochre-tailwind.css and ochre-motion.css (Tailwind v4). Size classes: S, M (default), L, XL, XXL.
     transition-ui + press give the springy press; links skip press. -->

<!-- Primary, M -->
<button type="button" class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-10 bg-action-primary px-3.5 h-10 text-[14px] leading-5 font-medium text-action-on-primary shadow-xs outline-none transition-ui press hover:bg-action-primary-hover focus-visible:shadow-focus disabled:pointer-events-none disabled:bg-action-disabled disabled:text-action-on-disabled disabled:shadow-none">
  Save changes
</button>

<!-- Secondary, M, with a leading icon -->
<button type="button" class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-10 border border-border-default bg-surface-card px-3.5 h-10 text-[14px] leading-5 font-medium text-action-on-secondary shadow-xs outline-none transition-ui press hover:border-border-hover hover:bg-action-secondary-hover focus-visible:shadow-focus [&_svg]:size-4">
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg>
  New project
</button>

<!-- Tertiary, M -->
<button type="button" class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-10 px-3.5 h-10 text-[14px] leading-5 font-medium text-text-default outline-none transition-ui press hover:bg-state-hover active:bg-state-pressed focus-visible:shadow-focus">
  Cancel
</button>

<!-- Ink, M -->
<button type="button" class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-10 bg-action-ink px-3.5 h-10 text-[14px] leading-5 font-medium text-action-on-ink shadow-xs outline-none transition-ui press hover:bg-action-ink-hover focus-visible:shadow-focus">
  Deploy
</button>

<!-- Danger, M -->
<button type="button" class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-10 bg-action-danger px-3.5 h-10 text-[14px] leading-5 font-medium text-action-on-danger shadow-xs outline-none transition-ui press hover:bg-action-danger-hover focus-visible:shadow-focus-danger">
  Delete workspace
</button>

<!-- Link -->
<a href="#" class="inline-flex items-center gap-2 text-[14px] leading-5 font-medium text-text-accent underline-offset-4 outline-none transition-ui hover:text-text-accent-hover hover:underline focus-visible:shadow-focus rounded-4">
  View changelog
</a>

<!-- Loading: the label stays (so the width holds), fades out, and a spinner fades in over it.
     Set data-loading="true" and aria-busy="true"; remove both when done. -->
<button type="button" data-loading="true" aria-busy="true" aria-disabled="true" class="group/btn relative inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-10 bg-action-primary px-3.5 h-10 text-[14px] leading-5 font-medium text-action-on-primary shadow-xs outline-none transition-ui press hover:bg-action-primary-hover focus-visible:shadow-focus data-[loading=true]:pointer-events-none">
  <span class="truncate transition-opacity duration-[var(--motion-base)] group-data-[loading=true]/btn:opacity-0">Save changes</span>
  <span class="absolute inset-0 hidden place-items-center group-data-[loading=true]/btn:grid group-data-[loading=true]/btn:animate-fade-in">
    <svg viewBox="0 0 24 24" fill="none" aria-hidden="true" class="size-4 animate-spin"><circle cx="12" cy="12" r="9" stroke="currentColor" stroke-opacity="0.25" stroke-width="2.5"/><path d="M21 12a9 9 0 0 0-9-9" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"/></svg>
  </span>
</button>

<!-- Icon only: square, the icon in place of the label. Give it an aria-label. -->
<button type="button" aria-label="Settings" class="inline-flex shrink-0 select-none items-center justify-center whitespace-nowrap rounded-10 border border-border-default bg-surface-card px-0 h-10 w-10 text-action-on-secondary shadow-xs outline-none transition-ui press hover:border-border-hover hover:bg-action-secondary-hover focus-visible:shadow-focus [&_svg]:size-4">
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/></svg>
</button>

<!-- Pill shape: swap rounded-10 for rounded-full. With an icon only, it becomes a round icon button. -->
<button type="button" class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-full bg-action-primary px-3.5 h-10 text-[14px] leading-5 font-medium text-action-on-primary shadow-xs outline-none transition-ui press hover:bg-action-primary-hover focus-visible:shadow-focus">
  Get started
</button>

<!-- Other sizes: swap the size classes on any variant -->
<!-- S   h-8  gap-1.5 rounded-8  px-3   text-[13px] leading-[18px] [&_svg]:size-3.5 -->
<!-- M   h-10 gap-2   rounded-10 px-3.5 text-[14px] leading-5      [&_svg]:size-4   -->
<!-- L   h-12 gap-2   rounded-12 px-4   text-[16px] leading-6      [&_svg]:size-[18px] -->
<!-- XL  h-14 gap-2.5 rounded-12 px-5   text-[18px] leading-7      [&_svg]:size-5   -->
<!-- XXL h-16 gap-3   rounded-16 px-6   text-[20px] leading-7      [&_svg]:size-6   -->
```

## Examples

### Variants

Seven variants, from the orange Primary to the quiet Link subtle.

```tsx
import { Button } from "@/components/ochre/button";

export default function ButtonVariants() {
  return (
    <div className="flex flex-wrap items-center gap-3">
      <Button variant="primary">Save changes</Button>
      <Button variant="secondary">Preview</Button>
      <Button variant="tertiary">Cancel</Button>
      <Button variant="ink">Deploy</Button>
      <Button variant="danger">Delete</Button>
      <Button variant="link" href="#">View changelog</Button>
      <Button variant="link-subtle" href="#">Skip for now</Button>
    </div>
  );
}
```

### Sizes

One size ladder for every control, icon buttons included. M is the desktop default; L and up are for touch.

```tsx
import { Settings } from "lucide-react";
import { Button } from "@/components/ochre/button";

const sizes = ["s", "m", "l", "xl", "xxl"] as const;

export default function ButtonSizes() {
  return (
    <div className="grid justify-items-center gap-4">
      <div className="flex flex-wrap items-end justify-center gap-3">
        <Button size="s">Small</Button>
        <Button size="m">Medium</Button>
        <Button size="l">Large</Button>
        <Button size="xl">Extra large</Button>
        <Button size="xxl">Huge</Button>
      </div>
      <div className="flex flex-wrap items-end justify-center gap-3">
        {sizes.map((size) => (
          <Button key={size} size={size} variant="secondary" iconOnly leadingIcon={<Settings />} aria-label={`Settings, ${size}`} />
        ))}
      </div>
    </div>
  );
}
```

### With icons

Icons sit either side of the label. Icon buttons come in the five solid variants and need an aria-label.

```tsx
import { ArrowRight, Pencil, Plus, Rocket, Settings, Share2, Trash2 } from "lucide-react";
import { Button } from "@/components/ochre/button";

export default function ButtonIcons() {
  return (
    <div className="grid justify-items-center gap-4">
      <div className="flex flex-wrap items-center justify-center gap-3">
        <Button leadingIcon={<Plus />}>New project</Button>
        <Button variant="secondary" trailingIcon={<ArrowRight />}>
          Continue
        </Button>
      </div>
      <div className="flex flex-wrap items-center justify-center gap-3">
        <Button iconOnly leadingIcon={<Pencil />} aria-label="Edit" />
        <Button variant="secondary" iconOnly leadingIcon={<Share2 />} aria-label="Share" />
        <Button variant="tertiary" iconOnly leadingIcon={<Settings />} aria-label="Settings" />
        <Button variant="ink" iconOnly leadingIcon={<Rocket />} aria-label="Deploy" />
        <Button variant="danger" iconOnly leadingIcon={<Trash2 />} aria-label="Delete" />
      </div>
    </div>
  );
}
```

### Loading and disabled

Loading keeps the width and swaps the leading icon for a spinner.

```tsx
import { Button } from "@/components/ochre/button";

export default function ButtonStates() {
  return (
    <div className="flex flex-wrap items-center gap-3">
      <Button loading>Saving</Button>
      <Button variant="secondary" loading>
        Uploading
      </Button>
      <Button disabled>Save changes</Button>
      <Button variant="secondary" disabled>
        Preview
      </Button>
    </div>
  );
}
```
