Skip to main content

IconBox

The IconBox component is a container that displays an icon with customizable styles and sizes, perfect for creating visual elements in your UI.

Basic Usage

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

const MyComponent = () => {
return <IconBox icon={<CubeIcon />} size="md" />;
};

Live Example

Props

NameTypeDescriptionRequiredDefault Value
insetbooleanWhether to use inset style for the icon boxNofalse
roundedbooleanWhether to use rounded cornersNofalse
borderbooleanWhether to show a border around the icon boxNofalse
size"xs" | "sm" | "md" | "lg" | "xl"Size of the icon boxNo"sm"
widthstringCustom width for the icon boxNo-
heightstringCustom height for the icon boxNo-
iconReact.ReactNodeIcon to display in the boxYes-
blankbooleanWhether to show a blank box without an iconNofalse
iconBoxStyleReact.CSSPropertiesCustom CSS styles for the icon boxNo-

Examples

Different Sizes

Small Size

Medium Size

Large Size

Style Variations

Default Style

Inset Style

Rounded Style

Bordered Style

Custom Dimensions

Custom Width and Height

Blank Box