Skip to content

co-button

This content is not available in your language yet.

Ver código
<co-button label="Guardar" variant="primary"></co-button>
<co-button label="Cancelar" variant="stroke"></co-button>
<co-button label="Ver más" variant="ghost" icon-right="arrow-right"></co-button>

Props

PropAtributoTipoDefaultDescripción
colorcolorstring | undefinedCustom background color (CSS value or token, e.g. "var(--co-color-secondary-rojo-100)")
disableddisabledbooleanfalseDisabled state
elevatedelevatedbooleanfalseRaised elevation — with variant="secondary" renders a white raised button (shadow-sm + inset hairline).
iconLefticon-leftstring | undefinedPhosphor icon name for the left position (e.g. "plus", "arrow-left")
iconRighticon-rightstring | undefinedPhosphor icon name for the right position (e.g. "arrow-right", "download")
iconSizeicon-sizenumber | undefinedOverride the size-derived glyph px (e.g. 24). Falls back to the size default.
iconWeighticon-weight"bold" | "duotone" | "fill" | "light" | "regular" | "thin"'regular'Icon weight applied to both iconLeft and iconRight
labellabelstring | undefinedText label (alternative to default slot)
shapeshape"rounded" | "square"'rounded'Shape: pill or straight corners
sizesize"l" | "m" | "s" | "xs"'m'Size
surfacesurface"dark" | "light"'light'Surface the button sits on. On "dark", ghost/stroke variants switch to white ink + blanco-16 hover.
textColortext-colorstring | undefinedCustom text/icon color (CSS value or token, e.g. "var(--co-color-base-blanco)")
typetype"button" | "reset" | "submit"'button'HTML button type — use "submit" inside forms
variantvariant"danger" | "ghost" | "primary" | "secondary" | "stroke" | "success"'primary'Visual style

Eventos

Este componente no emite eventos personalizados.

Slots

SlotDescripción
(default)Button label text

CSS Parts

PartDescripción
::part(button)

CSS Custom Properties

Este componente no expone CSS custom properties.