APill component is an atom that displays a badge with an optional avatar and close button. It extends Nuxt UI’s UBadge component with additional functionality.
Props
Avatar image source URL
Text label to display on the pill
Color theme of the badge. Derived from Nuxt UI’s UBadge component.
Visual style variant. Options include
outline, solid, soft, etc.Size of the badge. Options:
xs, sm, md, lg, xlWhether to show the avatar image
Whether to show the close button
Events
Emitted when the close button is clicked
Slots
default
The default slot for custom content within the pill
Usage
Basic Example
Without Avatar
Custom Sizes and Colors
Non-closable Pill
Type Exports
The component exports the following types for use in your application:Implementation Details
The component uses computed properties to adjust icon and text sizes based on thesize prop:
- Icon sizes:
size-3.5for xs-lg,size-4for xl - Text sizes: Responsive scaling from
text-xstotext-base - Spacing: Dynamic gap and padding based on size
/home/daytona/workspace/source/app/components/a/pill/a-pill.vue