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
Name | Type | Description | Required | Default Value |
---|---|---|---|---|
size | "xs" | "sm" | "md" | "lg" | "xl" | Size of the button | No | "sm" |
iconLeft | React.ReactNode | Icon to display on the left side of the button | No | - |
iconRight | React.ReactNode | Icon to display on the right side of the button | No | - |
isLoading | boolean | Whether the button is in a loading state | No | false |
rounded | boolean | Whether to use rounded corners | No | false |
border | boolean | Whether to show a border around the button | No | false |
children | React.ReactNode | Content to be displayed inside the button | No | - |
labelStyle | React.CSSProperties | Custom styles for the button label | No | - |
buttonStyle | React.CSSProperties | Custom styles for the button container | No | - |