<BaseMessage /> · A versatile message component.
<template>
<BaseMessage
icon
rounded="md"
>
A default message.
</BaseMessage>
</template>
This component accepts text content as a child. You can customize the message visual style by using the available props.
<template>
<BaseMessage>
<!-- Content goes here -->
</BaseMessage>
</template>
This component has props that you can use to modify its visual style.
| Prop | Type |
|---|---|
messagedefault: "" | stringThe message to display. |
icondefault: - | stringWhether to show an icon, or the name of the icon to display. |
close-icondefault: - | stringThe icon to show in the close button |
closabledefault: - | booleanWhether to show a close button. |
variantdefault: "default" | "default" | "primary" | "muted" | "success" | "info" | "warning" | "destructive"The variant of the message. |
roundeddefault: "sm" | "none" | "md" | "sm" | "lg" | "full"The radius of the message. |
as-childdefault: - | booleanChange 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. |
asdefault: - | AsTag | ComponentThe element or component this component should render as. Can be overwritten by `asChild`. |
| Event | Emitted Value Type |
|---|---|
close | [] |
| Slot | Type |
|---|---|
#default | any |
#icon | any |
#close-button | any |
Use the variant prop to control the color of the message.
<template>
<BaseMessage variant="success">
A successful message.
</BaseMessage>
<BaseMessage variant="info">
An information message.
</BaseMessage>
<BaseMessage variant="warning">
A warning message.
</BaseMessage>
<BaseMessage variant="destructive">
A destructive message.
</BaseMessage>
</template>
Use the icon prop to display an icon inside the message.
<template>
<BaseMessage
color="muted"
icon="mingcute:globe-fill"
rounded="md"
>
A muted message.
</BaseMessage>
<BaseMessage
color="primary"
icon="mingcute:bling-fill"
rounded="md"
>
A primary message.
</BaseMessage>
<BaseMessage icon rounded="md">
A successful message.
</BaseMessage>
<BaseMessage color="info" icon rounded="md">
An information message.
</BaseMessage>
<BaseMessage color="warning" icon rounded="md">
A warning message.
</BaseMessage>
<BaseMessage color="danger" icon rounded="md">
A destructive message.
</BaseMessage>
</template>
Use the rounded prop to control the border radius of the message.
<template>
<BaseMessage color="success" icon rounded="sm">
A successful message.
</BaseMessage>
<BaseMessage color="info" icon rounded="md">
An information message.
</BaseMessage>
<BaseMessage color="warning" icon rounded="lg">
A warning message.
</BaseMessage>
<BaseMessage color="danger" icon rounded="full">
A destructive message.
</BaseMessage>
</template>
Use the closable prop to display a close button on the message.
<template>
<BaseMessage color="success" icon rounded="sm">
A successful message.
</BaseMessage>
<BaseMessage color="info" icon rounded="md">
An information message.
</BaseMessage>
<BaseMessage color="warning" icon rounded="lg">
A warning message.
</BaseMessage>
<BaseMessage color="danger" icon rounded="full">
A destructive message.
</BaseMessage>
</template>