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 (
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.
Button clicked {clickCount} time{clickCount !== 1 ? 's' : ''}
)}Default state when button is ready for interaction.
Button cannot be interacted with.
Hover over the buttons below or use Tab to focus them. Notice the background color change and icon swap.
Buttons can be rendered without the arrow icon when needed.
Different button types for form submission and actions.
Example of handling async actions. The button is disabled during the async operation.
{clickCount > 0 && (Async action completed {clickCount} time{clickCount !== 1 ? 's' : ''}
)}Button padding adjusts automatically across breakpoints. Resize your browser window to see the changes:
{`import { Button } from 'shared/components/Button';
// Basic usage
// Disabled state
// Without icon
// Form integration
`}
| 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 |