import * as React from 'react'; import { Button } from 'shared/components/Button'; import { PageGrid, PageGridCol, PageGridRow } from 'shared/components/page-grid'; export const frontmatter = { seo: { title: 'BDS Button Component Showcase', description: 'Interactive showcase of the Brand Design System Button component with all states and variants.', }, }; export default function ButtonShowcase() { const [clickCount, setClickCount] = React.useState(0); const [isLoading, setIsLoading] = React.useState(false); const handleClick = () => { setClickCount((prev) => prev + 1); }; const handleAsyncClick = async () => { setIsLoading(true); await new Promise((resolve) => setTimeout(resolve, 2000)); setIsLoading(false); setClickCount((prev) => prev + 1); }; return (

BDS Button Component

Brand Design System

A scalable button component following the XRPL Brand Design System. This showcase demonstrates all states, responsive behavior, and accessibility features of the Primary button variant.

{/* Basic Usage */}

Basic Usage

Primary Variant
{clickCount > 0 && (

Button clicked {clickCount} time{clickCount !== 1 ? 's' : ''}

)}
{/* States */}

Button States

Interactive States
Enabled State

Default state when button is ready for interaction.

Disabled State

Button cannot be interacted with.

Hover & Focus States

Hover over the buttons below or use Tab to focus them. Notice the background color change and icon swap.

{/* Without Icon */}

Without Icon

Icon Control

Buttons can be rendered without the arrow icon when needed.

{/* Button Types */}

Button Types

Form Integration

Different button types for form submission and actions.

{ e.preventDefault(); alert('Form submitted!'); }} className="d-flex flex-wrap" >
{/* Loading State Simulation */}

Async Actions

Loading States

Example of handling async actions. The button is disabled during the async operation.

{clickCount > 0 && (

Async action completed {clickCount} time{clickCount !== 1 ? 's' : ''}

)}
{/* Responsive Behavior */}

Responsive Behavior

Breakpoint Adjustments

Button padding adjusts automatically across breakpoints. Resize your browser window to see the changes:

{/* Accessibility */}

Accessibility Features

WCAG Compliance
Keyboard Navigation
  • Tab to focus buttons
  • Enter or Space to activate
  • Focus indicator: 2px black border
  • Disabled buttons are not focusable
Screen Reader Support
  • Button labels are announced
  • Disabled state communicated via aria-disabled
  • Icons are hidden from screen readers (aria-hidden)
  • Semantic button element used
Color Contrast
  • Enabled: Black text (#141414) on Green 300 (#21E46B) = 9.06:1 (AAA)
  • Hover: Black text (#141414) on Green 200 (#70EE97) = 10.23:1 (AAA)
  • Disabled: Gray 500 (#838386) on Gray 200 (#E0E0E1) = 2.12:1 (acceptable for disabled state)
{/* Code Examples */}

Code Examples

Implementation
            {`import { Button } from 'shared/components/Button';

// Basic usage


// Disabled state


// Without icon


// Form integration
`}
          
{/* Design Specifications */}

Design Specifications

Visual Details
Typography
  • Font: Booton, sans-serif
  • Size: 16px
  • Weight: 400
  • Line Height: 23.2px
  • Letter Spacing: 0px
Spacing & Layout
  • Border Radius: 100px (fully rounded)
  • Icon Size: 15px × 14px
  • Icon Gap: 16px (default), 22px (hover/focus desktop), 21px (hover/focus mobile)
  • Min Height: 40px (touch target)
State Colors
State Text Color Background Color Border
Enabled #141414 (Neutral Black) #21E46B (Green 300) None
Hover #141414 (Neutral Black) #70EE97 (Green 200) None
Focus #141414 (Neutral Black) #70EE97 (Green 200) 2px solid #141414
Active #141414 (Neutral Black) #21E46B (Green 300) None
Disabled #838386 (Gray 500) #E0E0E1 (Gray 200) None
); }