Skip to main content

Button

The Button component is a clickable element that triggers an action or event, with support for various styles, icons, and states.

Basic Usage

import { Button, ThemeProvider } from "@carton-org/react-neumorphism";

const MyComponent = () => {
return <Button size="md">Click me</Button>;
};

Live Example

Props

NameTypeDescriptionRequiredDefault Value
size"xs" | "sm" | "md" | "lg" | "xl"Size of the buttonNo"sm"
iconLeftReact.ReactNodeIcon to display on the left side of the buttonNo-
iconRightReact.ReactNodeIcon to display on the right side of the buttonNo-
isLoadingbooleanWhether the button is in a loading stateNofalse
roundedbooleanWhether to use rounded cornersNofalse
borderbooleanWhether to show a border around the buttonNofalse
childrenReact.ReactNodeContent to be displayed inside the buttonNo-
labelStyleReact.CSSPropertiesCustom styles for the button labelNo-
buttonStyleReact.CSSPropertiesCustom styles for the button containerNo-

Examples

Different Sizes

Small Size

Medium Size

Large Size

With Icons

Left Icon

Right Icon

Both Icons

Loading State

Rounded and Bordered

Rounded Button

Bordered Button