Fidely UI v1 beta is now available!. 🚀

Button

Used to trigger an action or event

Usage

import { Button } from '@fidely-ui/react/button'
<Button>Click Me</Button>

Sizes

You can control the size of the Button using the size prop.

Variants

You can control the appearance of the button using the variant prop.

Use the asChild prop to render the button as another element, such as a link.

Ripple Effect

Use the ripple prop to enable a ripple animation.

By default, Fidely UI uses the current button color as the ripple background.

With Icon

Use icons within a button

Loading Button

Use the isLoading prop to show a loading spinner inside the button while an action is in progress.

Loading Button with Text

Use the isLoading and loadingText props together to display custom text while loading.

Disabled

Use the disabled prop to disable the button.

Spinner Placement

Use the spinnerPlacement prop to set the placement of the spinner.

With Custom Spinner

Use the spinner prop to change the spinner.

Props

Button

PropDefaultTypeDescription
spinnerPlacementstart'start' | 'end' | undefinedThe placement of the spinner.
colorPalettegray"red" | "blue" | "green" | "purple" | "orange" | "gray"The color palette of the component.
sizemd'2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'The size of the button.
variantsolid'solid' | 'subtle' | 'outline' | 'ghost' | 'plain'The variant that defines the button's visual style.
loading—boolean | undefinedIf true, the button will display a loading spinner.
loadingText—React.ReactNode | undefinedThe text to display while the button is loading.
spinner—React.ReactNode | undefinedThe spinner element to render while loading.
as—React.ElementTypeThe underlying element to render.
asChildfalsebooleanUse the provided child element as the default rendered element, combining their props and behavior.