<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 |
---|---|
variant default: "default" | "default" | "primary" | "dark" | "muted" | "none" The variant of the tag. |
size default: "sm" | "sm" | "md" | "lg" The size of the tag. |
rounded default: "full" | "none" | "sm" | "md" | "lg" | "full" The radius of the tag. |
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: "span" | AsTag | Component The 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>