import * as React from 'react'; import { Button } from 'shared/components/Button'; import { PageGrid, PageGridCol, PageGridRow } from 'shared/components/PageGrid/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 handleClick = () => { 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.

{/* Black Color Variant */}

Black Color Variant

Color Theme

Primary buttons can use a black color theme for dark backgrounds or alternative styling needs.

{/* Black Variant States */}

Black Variant States

Interactive States
Enabled State

Black background with white text.

Disabled State

Same disabled styling as green variant.

Hover & Focus States

Hover over the buttons or use Tab to focus them. Notice the background darkens slightly on hover.

{/* Green vs Black Comparison */}

Green vs Black Comparison

Color Themes

Compare the green (default) and black color themes side by side.

{/* 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" >
{/* 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 (green theme - default)


// Black color theme


// 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 - Green Theme
{/* Header */}
State
Text Color
Background Color
Border
{/* Rows */}
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
State Colors - Black Theme
{/* Header */}
State
Text Color
Background Color
Border
{/* Rows */}
Enabled
#FFFFFF (White)
#141414 (Neutral Black)
None
Hover
#FFFFFF (White)
rgba(20, 20, 20, 0.8) (80% Black)
None
Focus
#FFFFFF (White)
rgba(20, 20, 20, 0.8) (80% Black)
2px solid #141414
Active
#FFFFFF (White)
#141414 (Neutral Black)
None
Disabled
#838386 (Gray 500)
#E0E0E1 (Gray 200)
None
); }