Usage
Default
Use the label prop to set the text of the component.
vue
Colors
Use the color prop to customize the component's color.
vue
Variants
Use the variant prop to customize the component's appearance.
vue
Icons
Use the icon prop to position an icon before the label.
vue
<script setup lang="ts">
import CLPill from '@codeandfunction/callaloo/CLPill';
import { CLColors, CLColorVariants, CLIconNames } from '@codeandfunction/callaloo';
</script>
<template>
<CLPill :color="CLColors.Primary" :icon="CLIconNames.Tag" :variant="CLColorVariants.Soft" label="Tag" />
<CLPill :color="CLColors.Success" :icon="CLIconNames.Check" :variant="CLColorVariants.Soft" label="Verified" />
<CLPill :color="CLColors.Info" :icon="CLIconNames.InfoCircle" :variant="CLColorVariants.Soft" label="Info" />
</template>Count
Use the count prop to display a count value alongside the label.
vue
Rounded
Use the rounded prop to control the border radius. By default, pills are rounded.
vue
<script setup lang="ts">
import CLPill from '@codeandfunction/callaloo/CLPill';
import { CLColors } from '@codeandfunction/callaloo';
</script>
<template>
<CLPill :color="CLColors.Primary" label="Rounded" rounded />
<CLPill :color="CLColors.Primary" :rounded="false" label="Not Rounded" />
</template>Elevated
Use the elevated prop to add a drop shadow.
vue
Clickable
Use the onClick prop to make the pill interactive. When a click handler is provided, the pill becomes clickable.
vue
<script setup lang="ts">
import CLPill from '@codeandfunction/callaloo/CLPill';
import { CLColors, CLColorVariants } from '@codeandfunction/callaloo';
const handleClick = () => {
console.log('Pill clicked!')
}
</script>
<template>
<CLPill :color="CLColors.Primary" :variant="CLColorVariants.Soft" label="Click me" :onClick="handleClick" />
</template>