Ir al contenido

co-chip

Ver código
<co-chip label="Activo" color="success"></co-chip>
<co-chip label="Pendiente" color="warning" removable></co-chip>
<co-chip label="Cerrado" color="error"></co-chip>

Props

PropAtributoTipoDefaultDescripción
clickableclickablebooleanfalseMake the chip clickable (emits coClick)
colorcolor"default" | "error" | "info" | "pending" | "primary" | "progress" | "review" | "submitted" | "success" | "warning"'default'Semantic color
disableddisabledbooleanfalseDisabled state
dotdotbooleanfalseShow a leading colour dot (status/value colour). Reflected for hydration.
dotColordot-colorstring | undefinedColour of the leading dot (hex or any CSS colour). Reflected for hydration.
iconLefticon-leftstring | undefinedIcon name for the left icon (prop-based, uses co-icon — any Phosphor icon name)
iconModeicon-mode"both" | "left" | "none"'none'Icon mode (for slot-based icons): - none = no icon slots - left = icon before label (Figma "1nd Icon") - both = icon before + icon after (Figma "2nd Icon")
iconRighticon-rightstring | undefinedIcon name for the right icon (prop-based, uses co-icon — any Phosphor icon name)
iconWeighticon-weight"bold" | "duotone" | "fill" | "light" | "regular" | "thin"'regular'Icon weight applied to prop-based iconLeft / iconRight / trailingIcon.
labellabelstring | undefinedText label (alternative to default slot)
removableremovablebooleanfalseShow dismiss/remove button and emit coRemove on click. Reflected so it survives lazy hydration when set via a framework wrapper.
selectedselectedbooleanfalseSelected / active state
shapeshape"rounded" | "square"'rounded'Shape: pill or straight corners
sizesize"large" | "small"'large'Size: large (12px text), small (10px text)
trailingIcontrailing-iconstring | undefinedTrailing icon name (prop-based, uses co-icon — any Phosphor icon name), e.g. 'caret-down'. In the `filter` variant it renders at 13px in gray-400; in other variants it inherits the chip text colour.
valueLabelvalue-labelstring | undefinedMuted two-tone value suffix rendered right after the label as ": <valueLabel>" (e.g. label "Ordenar" + valueLabel "Reciente" → "Ordenar: Reciente"). The suffix is coloured with --co-chip-value-color (default gray-500). Omit for a plain chip.
variantvariant"filled" | "filter" | "outlined"'filled'Visual variant. - filled/outlined = existing tag/chip looks (unchanged defaults). - filter = Cloud Drive filter-trigger pill (white pill, inset hairline ring, tinted leading icon, two-tone value, trailing caret).

Eventos

EventoDetailBubblesCancelableDescripción
coClickvoidEmitted when the chip body is clicked (only if clickable)
coRemovevoidEmitted when the remove button is clicked

Slots

SlotDescripción
(default)Label text
icon-leftIcon before label (1nd Icon mode)
icon-rightIcon after label (2nd Icon mode)

CSS Parts

PartDescripción
::part(chip)
::part(dot)
::part(icon-left)
::part(icon-right)
::part(remove)
::part(trailing)
::part(value)

CSS Custom Properties

Este componente no expone CSS custom properties.