Skip to content

co-drop-zone

This content is not available in your language yet.

Envuelve contenido arbitrario y muestra una superposición punteada encima mientras hay un arrastre en curso. Puede controlarse desde el consumidor con active o autogestionarse escuchando los eventos nativos de drag, emitiendo coDrop y coDragStateChange.

Ver código
<co-drop-zone active label="Suelta para subir" icon="upload-simple">
<div style="width:100%;height:200px;border-radius:16px;background:var(--co-color-gray-100)"></div>
</co-drop-zone>

Props

PropAtributoTipoDefaultDescripción
accentaccentstring'var(--co-color-primary-azul)'Accent color for the dashed border, badge icon and tinted background.
activeactivebooleanfalseWhether the drag-to-upload overlay is visible.
iconiconstring'upload-simple'Phosphor icon name shown in the badge.
labellabelstring'Suelta para subir'Overlay label text.

Eventos

EventoDetailBubblesCancelableDescripción
coDragStateChangebooleanEmitted whenever the internal drag-over state flips.
coDropFile[]Emitted with the dropped files.

Slots

Este componente no expone slots.

CSS Parts

PartDescripción
::part(badge)
::part(host)
::part(label)
::part(overlay)

CSS Custom Properties

Este componente no expone CSS custom properties.