Skip to content

Button

Buttons represent actions that are available to the user.

Link Button
// Import component
import { Button } from '@fintech-sandpit/ui/react';
// Import styles (optional)
import '@fintech-sandpit/ui/style/components/button.css';
return (
<Button
colorScheme="primary"
size="lg"
variant="outline"
>
Click me
</Button>
);
// Import components
import {
Button,
Icon,
} from '@fintech-sandpit/ui/react';
// Import styles (optional)
import '@fintech-sandpit/ui/style/components/button.css';
import '@fintech-sandpit/ui/style/components/icon.css';
// Import icon
import { faCheck } from '@fortawesome/free-solid-svg-icons';
return (
<Button>
<Icon
as={faCheck}
className="mr-2"
/>
With Left Icon
</Button>
);
// Import components
import {
Button,
Icon,
} from '@fintech-sandpit/ui/react';
// Import styles (optional)
import '@fintech-sandpit/ui/style/components/button.css';
import '@fintech-sandpit/ui/style/components/icon.css';
// Import icon
import { faCheck } from '@fortawesome/free-solid-svg-icons';
return (
<Button>
With Right Icon
<Icon
as={faCheck}
className="ml-2"
/>
</Button>
);
// Import components
import {
Button,
Icon,
} from '@fintech-sandpit/ui/react';
// Import styles (optional)
import '@fintech-sandpit/ui/style/components/button.css';
import '@fintech-sandpit/ui/style/components/icon.css';
// Import icon
import { faCheck } from '@fortawesome/free-solid-svg-icons';
return (
<Button iconOnly>
<Icon as={faCheck} />
</Button>
);
// Import components
import {
Button,
Link,
} from '@fintech-sandpit/ui/react';
// Import styles (optional)
import '@fintech-sandpit/ui/style/components/button.css';
import '@fintech-sandpit/ui/style/components/link.css';
return (
<Button asChild>
<Link href="#">
Link Button
</Link>
</Button>
);
NameTypeRequiredDefaultDescription
colorSchemeColorSchemeneutralColor scheme
sizeSizemdButton size
variantButtonVariantsolidVisual variant
disabledbooleanfalseDisabled state
loadingbooleanfalseLoading state
asChildbooleanfalseUse the provided child element as the default rendered element, combining their props and behavior
NameArgumentsDescription
onClickMouseEventClick event
type ButtonVariant = 'solid' | 'subtle' | 'outline' | 'ghost'
type ColorScheme = 'neutral' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger'
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl'