Meridianby Commenda
Components

Button

Start an action, from a page CTA to a card link.

Starts an action. Pathfinder Button with one more size, xl 40, so a button sits next to the 40 Input, and a link-arrow variant for card and section links. Five variants, three sizes and seven states.

Click Save changes to preview loading and completion. It resets on its own so you can try again.

Usage

Example.tsx
import { Button } from "@commenda/meridian/ui/button";

<Button size="xl" onClick={onSave}>Save changes</Button>;

// Navigation is a real link: render the button as an anchor.
<Button size="xl" nativeButton={false} render={<a href="/book-a-demo" />}>
  Book a demo
</Button>;

The Pathfinder stylesheet comes with the component; there is nothing else to import.

Sizes

md 32 inside cards and tables, lg 36 in the nav and on phones, xl 40 for page CTAs. Height comes from the control token; width hugs the label.

md · 32
lg · 36
xl · 40

Variants

Primary for the one main action in a view, secondary beside it, tertiary for quiet repeated actions. Link sits inline with copy; link-arrow ends a card or section.

primary
secondary
tertiary
link
link-arrow

Icons

A left icon only when it adds meaning. A right icon for a trailing arrow. link-arrow always carries its arrow.

States

Hover and pressed come from interaction, focus only from the keyboard. Loading puts the spinner beside the label; done confirms with a check. Disabled stays focusable and can explain why.

default
disabled
Savingloading
Saveddone
default
disabled
Savingloading
Saveddone
default
disabled
Savingloading
Saveddone
default
disabled

Hover and press any button above; Tab to see focus.

Next to an input

A button beside a field is always xl 40, 12 apart. On phones they stack, both full width.

Anatomy

Every part is optional except the container and label. Icons take the label colour.

Partmd · lgxl
Container height32 · 36 (control/md, control/lg)40 (control/xl)
Padding1216 (spacing/xl)
Gap, label to icon68 (spacing/md)
Icon16 · 2020
LabelLabel/13 Strong · Label/15 StrongLabel/16 Strong
Radius8 (radius/md)8 (radius/md)

API reference

PropTypeDescription
variant"link" | "primary" | "secondary" | "tertiary" | "link-arrow"Figma variant. One primary per view.
size"md" | "lg" | "xl"Figma size: md 32 in cards and tables, lg 36 in the nav and on phones, xl 40 for page CTAs.
completionConfigCompletionConfigView fieldsFigma state done: the label and check shown after a successful action.
classNamestringFrom Pathfinder.
styleCSSProperties | ((state: ButtonState) => CSSProperties | undefined)Style applied to the element, or a function that returns a style object based on the component's state.
focusableWhenDisabledbooleanWhether the button should be focusable when disabled.
nativeButtonbooleanWhether the component renders a native <button> element when replacing it via the render prop. Set to false if the rendered element is not a button (for example, <div>).
renderReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ButtonState>Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
loadingConfigLoadingConfigView fieldsFrom Pathfinder.
leadingIconReactNodeFrom Pathfinder.
trailingIconReactNodeFrom Pathfinder.
disabledReasonstringFrom Pathfinder.
completionConfigObject fields
FieldTypeDescription
isCompleteRequiredboolean
labelRequiredstring
iconReactNode
loadingConfigObject fields
FieldTypeDescription
isLoadingRequiredboolean
labelstring

Best practices

  • One primary per view. Everything beside it is secondary or tertiary.
  • 12 between buttons. Labels never wrap: shorten the label instead.
  • A button next to an Input is xl 40, the same height as the field.
  • On phones every button is lg 36, or full-width xl under an input.
  • "Book a demo" goes to /book-a-demo.
  • Source: Pathfinder Button. Meridian adds size xl and variant link-arrow; everything else matches Pathfinder.

On this page