<BaseTag /> · An informative small piece of content.
<template>
<BaseTag>
Label
</BaseTag>
</template>
This component can have any content inside it. It is used to display an informative small piece of content.
<template>
<BaseTag>
<!-- Your content here -->
</BaseTag>
</template>
This component has props that you can use to modify its visual style.
| Prop | Type |
|---|---|
variantdefault: "default" | "default" | "primary" | "dark" | "muted" | "none"The variant of the tag. |
sizedefault: "sm" | "sm" | "md" | "lg"The size of the tag. |
roundeddefault: "full" | "none" | "sm" | "md" | "lg" | "full"The radius of the tag. |
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: "span" | AsTag | ComponentThe element or component this component should render as. Can be overwritten by `asChild`. |
| Slot | Type |
|---|---|
#default | any |
Your can override the component default CSS variables in your main.css file.
@theme {
/* Tag default variables */
--color-tag-default-bg: var(--color-white);
--color-tag-default-border: var(--color-muted-400);
--color-tag-default-text: var(--color-muted-400);
/* Tag muted variables */
--color-tag-muted-bg: var(--color-muted-400);
--color-tag-muted-border: var(--color-muted-400);
--color-tag-muted-text: var(--color-muted-400);
/* Tag dark variables */
--color-tag-dark-bg: var(--color-muted-900);
--color-tag-dark-border: var(--color-muted-900);
--color-tag-dark-text: var(--color-muted-900);
}
Use the size prop to change the size of the tag.
<template>
<BaseTag size="sm">
Label
</BaseTag>
<BaseTag size="md">
Label
</BaseTag>
<BaseTag size="lg">
Label
</BaseTag>
</template>
Use the rounded prop to change the radius of the tag.
<template>
<BaseTag variant="default">
Label
</BaseTag>
<BaseTag variant="muted">
Label
</BaseTag>
<BaseTag variant="primary">
Label
</BaseTag>
<BaseTag variant="dark">
Label
</BaseTag>
</template>
Use the variant prop to change the style of the tag.
<template>
<BaseTag variant="solid" color="primary">
Label
</BaseTag>
<BaseTag variant="pastel" color="primary">
Label
</BaseTag>
<BaseTag variant="outline" color="primary">
Label
</BaseTag>
</template>
Set the variant prop to none to remove the default colors and apply your own.
<template>
<BaseTag
variant="none"
class="bg-yellow-400/20 text-yellow-400 ring-1 ring-inset ring-yellow-400/30"
>
Label
</BaseTag>
</template>