Ir al contenido

co-modal

Ver código
<co-modal heading="Título de ejemplo"></co-modal>

Props

PropAtributoTipoDefaultDescripción
closableclosablebooleantrueShow close (X) button in header
closeOnEscapeclose-on-escapebooleanfalseOpt-in: close when Escape is pressed. Default false → existing consumers are unchanged. Handled here rather than by forwarding co-overlay's own `closeOnEscape`: co-overlay emits the SAME `coClose` for a backdrop click and for Escape, and this component gates that event on `closeOnOverlay`. Forwarding would therefore swallow Escape whenever `closeOnOverlay` is false.
closeOnOverlayclose-on-overlaybooleantrueClose when clicking the overlay backdrop
descriptiondescriptionstring | undefinedSubtitle / description
headingheadingstring''Modal title
noDividersno-dividersbooleanfalseHide body section and all border dividers (compact confirm dialogs)
openopenbooleanfalseWhether the modal is visible
sizesize"full" | "lg" | "md" | "sm"'md'Modal width: sm (400px), md (540px), lg (680px), full (min(1400px, 95vw) × 92vh — media/document viewers). `full` also drops the body padding and lets the body grow, so a slotted <video>/<iframe> fills the panel edge-to-edge instead of sitting in a content-height box.

Eventos

EventoDetailBubblesCancelableDescripción
coAfterClosevoidClose animation finished.
coAfterOpenvoidOpen animation finished.
coClosevoidEmitted when the modal requests to close

Slots

SlotDescripción
(default)Modal body content
footerFooter with action buttons

CSS Parts

PartDescripción
::part(body)
::part(footer)
::part(header)
::part(modal)

CSS Custom Properties

Este componente no expone CSS custom properties.