Fidely UI v1 beta is now available!. 🚀

IconButton

A button that displays an icon instead of text, ideal for compact actions.

Usage

import { IconButton } from '@fidely-ui/react'
<IconButton>
  <YourCustomIcon />
</IconButton>

Sizes

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

Variants

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

ColorPalette

Use the colorPalette prop to change the color and background appearance of the icon-button.

With Spinner

When using IconButton with spinner pass the isLoading prop

Props

IconButton

PropDefaultTypeDescription
aria-label-stringaria-label for.
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.