Skip to main content

Pathfinder 1.0 Just launched! Get it now with special launch pricing Learn more

Button

The Button component provides a flexible and customizable button element that can be used throughout your documentation. It supports multiple variants, sizes, and can function as either a button or link.

Basic Usage

The most basic button uses the secondary variant and medium size by default.

The Button component can also function as a link by providing an href prop.

Variants

The Button component comes with several variants to suit different contexts and purposes:

Each variant serves a specific purpose:

  • primary: For primary actions with high emphasis
  • secondary: Default variant for standard actions
  • outline: Subtle variant with just a border
  • ghost: Most subtle variant without background or border
  • info, success, warning, error: Status variants for different states

Sizes

The Button component supports different sizes to fit various contexts.

Props

PropTypeDefaultDescription
variant"primary" | "secondary" | "outline" | "ghost" | "info" | "success" | "warning" | "error""secondary"Sets the visual style of the button
size"sm" | "md" | "lg" | "icon""md"Controls the size of the button
hrefstringundefinedOptional URL. If provided, renders as an <a> tag instead of a <button>

The component also accepts all standard HTML attributes for both <button> and <a> elements.

Features

Icon Support

The Button component automatically styles icons to maintain consistent spacing and sizing:

  • Icons are set to a fixed size (16x16px)
  • Pointer events are disabled on icons
  • Icons maintain consistent spacing with text

Accessibility

The Button component includes several accessibility features:

  • Proper focus states with visible outlines
  • Disabled state styling
  • Semantic HTML (<button> or <a> as appropriate)
  • Maintains proper contrast ratios for all variants