<BaseIconBox />
· A versatile icon container.
<template>
<BaseIconBox>
<Icon name="solar:home-smile-angle-linear" class="size-6" />
</BaseIconBox>
</template>
This component any content as a child, though it is preferable to use it as an icon container. You can customize the icon box's visual style by using the available props.
<template>
<BaseIconBox>
<!-- Icon here -->
</BaseIconBox>
</template>
This component has props that you can use to modify its visual style.
Prop | Type |
---|---|
variant default: "default" | "default" | "primary" | "dark" | "none" | "muted" The variant of the box. |
size default: "xs" | "md" | "xs" | "sm" | "lg" | "xl" | "2xl" The size of the icon. |
rounded default: "sm" | "none" | "md" | "sm" | "lg" | "full" The radius of the icon. |
mask default: - | "hex" | "hexed" | "deca" | "blob" | "diamond" Applies an svg mask from the available presets. (needs rounded to be set to `none`). |
as-child default: - | boolean Change the default rendered element for the one passed as a child, merging their props and behavior. Read our [Composition](https://www.reka-ui.com/docs/guides/composition) guide for more details. |
as default: - | AsTag | Component The element or component this component should render as. Can be overwritten by `asChild`. |
Slot | Type |
---|---|
#default | any |
Use the size
prop to control the size of the icon box.
<template>
<BaseIconBox
size="md"
>
<Icon name="solar:home-smile-angle-linear" class="size-5" />
</BaseIconBox>
</template>
Use the rounded
prop to control the border radius of the icon box.
<template>
<BaseIconBox
rounded="md"
>
<Icon name="solar:home-smile-angle-linear" class="size-5" />
</BaseIconBox>
</template>
Use the variant
prop to control the visual style of the icon box.
<template>
<BaseIconBox
variant="default"
>
<Icon name="solar:home-smile-angle-linear" class="size-5" />
</BaseIconBox>
</template>
Use the none
variant to create your own set of solid color icon boxes.
<template>
<BaseIconBox
variant="none"
class="bg-green-500 text-white"
>
<Icon name="solar:home-smile-angle-linear" class="size-5" />
</BaseIconBox>
</template>
Use the pastel
variant and the color
prop to change the color of the icon box.
<template>
<BaseIconBox
variant="pastel"
color="primary"
>
<Icon name="ph:game-controller-duotone" class="size-5" />
</BaseIconBox>
</template>
Use the outline
variant and the color
prop to change the color of the icon box.
<template>
<BaseIconBox
variant="outline"
color="primary"
>
<Icon name="ph:game-controller-duotone" class="size-5" />
</BaseIconBox>
</template>
Use the mask
prop combined to the rounded
prop set to none
to display an svg mask.
<template>
<BaseIconBox
size="md"
rounded="none"
mask="blob"
variant="pastel"
color="success"
>
<Icon name="ph:leaf-duotone" class="size-5" />
</BaseIconBox>
</template>