Componente Modal para Angular | ng-hub-ui-modal

Componente modal accesible para Angular con apilado, modo fullscreen, plantillas, manejo de teclado y variables CSS para apps standalone.

Referencia API

Inputs

animation

Tipo: boolean

If true, modal opening and closing will be animated. Default: true

backdrop

Tipo: boolean | "static"

If true, the backdrop element will be created. Alternatively, specify "static" for a backdrop which doesn't close the modal on click. Default: true

centered

Tipo: boolean

If true, the modal will be centered vertically. Default: false

placement

Tipo: HubModalPlacement

Controls where the modal is placed within the viewport. Default: HubModalPlacement.Center

keyboard

Tipo: boolean

If true, the modal will be closed when Escape key is pressed. Default: true

closeOnNavigation

Tipo: boolean

If true, the modal will be closed when the user navigates back in browser history (history.back(), browser back button). Default: true

size

Tipo: "sm" | "lg" | "xl" | string

Size of the modal window

windowClass

Tipo: string

A custom class to append to the modal window

backdropClass

Tipo: string

A custom class to append to the modal backdrop

dismissSelector

Tipo: string

Custom selector for elements that can trigger the dismissal of the modal window. Default: "[data-dismiss=\"modal\"]"

closeSelector

Tipo: string

Custom selector for elements that can trigger the closing of the modal window. Default: "[data-close=\"modal\"]"

headerSelector

Tipo: string

Custom selector for the header element of the modal window

footerSelector

Tipo: string

Custom selector for the footer element of the modal window

data

Tipo: any

Additional data that needs to be passed to the modal window when it is opened

Outputs

Todavía no hay outputs documentados.

Templates

Modal Template

Template reference that can be passed to the modal service

Ejemplo:

Variables CSS

Variables base del modal

Variables base de estilo para la estructura y el posicionamiento del modal

--bs-modal-zindex

Tipo: number

Por defecto:1055

Z-index of the modal

--bs-modal-width

Tipo: length

Por defecto:500px

Default modal width

--bs-modal-padding

Tipo: length

Por defecto:1rem

Padding around modal content

--bs-modal-margin

Tipo: length

Por defecto:0.5rem

Margin around modal dialog

Apariencia del modal

Variables que controlan colores, bordes y efectos visuales del modal

--bs-modal-color

Tipo: color

Por defecto:var(--bs-body-color)

Text color of modal content

--bs-modal-bg

Tipo: color

Por defecto:var(--bs-body-bg)

Background color of modal content

--bs-modal-border-color

Tipo: color

Por defecto:var(--bs-border-color-translucent)

Border color of modal

--bs-modal-border-width

Tipo: border

Por defecto:var(--bs-border-width)

Border width of modal

--bs-modal-border-radius

Tipo: border

Por defecto:var(--bs-border-radius-lg)

Border radius of modal

--bs-modal-box-shadow

Tipo: shadow

Por defecto:0 0.125rem 0.25rem rgba(0, 0, 0, 0.075)

Box shadow of modal

Cabecera del modal

Variables de estilo para la cabecera del modal

--bs-modal-header-padding-x

Tipo: length

Por defecto:1rem

Horizontal padding of modal header

--bs-modal-header-padding-y

Tipo: length

Por defecto:1rem

Vertical padding of modal header

--bs-modal-header-border-color

Tipo: color

Por defecto:var(--bs-border-color)

Border color of modal header

--bs-modal-header-border-width

Tipo: border

Por defecto:0 0 var(--bs-border-width) 0

Border width of modal header

Footer del modal

Variables de estilo para el footer del modal

--bs-modal-footer-gap

Tipo: length

Por defecto:0.5rem

Gap between elements in modal footer

--bs-modal-footer-border-color

Tipo: color

Por defecto:var(--bs-border-color)

Border color of modal footer

--bs-modal-footer-border-width

Tipo: border

Por defecto:var(--bs-border-width) 0 0 0

Border width of modal footer

Estilos y theming

Todavía no hay ejemplos de estilos documentados. Esta sección incluirá recetas de personalización y ejemplos de theming.