Skip to content

Button

The Button component is a versatile and interactive element for triggering actions in your application.
It supports multiple variants, colors, sizes, and can include icons, loading indicators, or render as a link.
Use it to create consistent, accessible, and visually appealing buttons across your UI.

Use the variant prop to change the visual style of the button (text, contained, outlined).

Use the class or style prop to change the color of the button, including background and text color.

Use the size prop to adjust the button’s size for different contexts, such as form actions or toolbars.

Pass the isLoading prop to show a spinner or loading indicator inside the button. Ideal for async actions.

Include an icon inside the button for actions like “submit”, “delete”, or “download”.

Render a button as a link using the href prop. Use target to control link behavior (e.g., _blank).

Disable the button to prevent interactions using the disabled prop.

The press effect provides visual feedback when clicking the button.
Use pressedEffect to disable this animation if desired.

PropTypeDefaultDescription
variantstring"default"Changes the visual style of the button (e.g., text, contained, outlined).
sizestring"md"Adjusts the button size (sm, md, lg).
classstring""Custom classes for colors, borders, or other styles.
isLoadingbooleanfalseShows a loading spinner when true.
disabledbooleanfalseDisables the button, preventing user interaction.
pressedEffectbooleantrueEnables or disables the press effect animation.
hrefstring""Renders the button as a link if provided.
targetstring"_self"Target attribute for link buttons.
iconslotOptionalInclude an icon inside the button.
  • Use variants consistently across your app for clarity.
  • Always provide loading states for async actions.
  • Combine icons and text for better accessibility and UX.
  • Ensure contrast and color accessibility for visibility.
  • Prefer using href for navigation actions to keep semantic HTML.