Angular モーダルコンポーネント | ng-hub-ui-modal

スタッキング、フルスクリーンモード、テンプレート、キーボード処理、CSS 変数を備えたアクセシブルな Angular モーダルコンポーネント。standalone アプリ向けです。

スタイル

ミックスインとスタイル

Override any of the `--hub-modal-*` design tokens in a single include. Every parameter is OPTIONAL and defaults to `null`: only the parameters you pass are emitted, so the rest keep the component's defaults. Token-based and self-contained (no Bootstrap dependencies).

Theming with hub-modal-theme
ミックスインパラメータ説明
Theming
hub-modal-theme()
$accent--hub-modal-accent
$accent-subtle--hub-modal-accent-subtle
$accent-border--hub-modal-accent-border
$accent-bar-width--hub-modal-accent-bar-width
$bg--hub-modal-bg
$color--hub-modal-color
$title-color--hub-modal-title-color
$border-color--hub-modal-border-color
$border-width--hub-modal-border-width
$border-radius--hub-modal-border-radius
$box-shadow--hub-modal-box-shadow
$max-width--hub-modal-max-width
$header-padding-x--hub-modal-header-padding-x
$header-padding-y--hub-modal-header-padding-y
$header-gap--hub-modal-header-gap
$header-border-color--hub-modal-header-border-color
$body-padding-x--hub-modal-body-padding-x
$body-padding-y--hub-modal-body-padding-y
$footer-padding-x--hub-modal-footer-padding-x
$footer-padding-y--hub-modal-footer-padding-y
$footer-gap--hub-modal-footer-gap
$footer-border-color--hub-modal-footer-border-color
$backdrop-bg--hub-modal-backdrop-bg
One-call theming for `<hub-modal>` dialogs

CSS 変数

87 個の CSS 変数であらゆるピクセルをテーマ設定。:root で上書きするか、ラッパーにスコープを限定できます。

Modal

Design tokens read by this component. Override them on the host element (or any ancestor) to customize; every default falls back to the ng-hub-ui-ds layer.

変数デフォルト説明
--hub-modal-zindexvar(--hub-sys-zindex-modal, 1055)number Modal layer z-index
--hub-modal-backdrop-zindexcalc(var(--hub-modal-zindex, var(--hub-sys-zindex-modal, 1055)) - 1)number Backdrop layer z-index
--hub-modal-accentvar(--hub-sys-color-primary, #0d6efd)color Semantic accent (opt-in via variant); re-based per variant
--hub-modal-accent-subtlecolor-mix(in oklch, var(--hub-modal-accent) 12%, var(--hub-sys-surface-page, #ffffff))color Variant tinted background (generated from the accent)
--hub-modal-accent-bordercolor-mix(in oklch, var(--hub-modal-accent) 35%, var(--hub-sys-surface-page, #ffffff))color Variant accent-tinted border (outer + header/footer rules)
--hub-modal-accent-bar-widthvar(--hub-ref-space-1, 0.25rem)color Thickness of the variant accent bar atop the dialog
--hub-modal-title-colorvar(--hub-modal-color, var(--hub-sys-text-primary, #212529))color Title colour; a variant re-points it to the accent
--hub-modal-widthautolength Base dialog width
--hub-modal-max-width500pxlength Dialog max-width
--hub-modal-colorvar(--hub-sys-text-primary, #212529)color Base modal text color
--hub-modal-bgvar(--hub-sys-surface-page, #ffffff)color Modal content background
--hub-modal-border-colorvar(--hub-sys-border-color-default, #dee2e6)color Modal border color
--hub-modal-border-widthvar(--hub-ref-border-width, 1px)length Modal border width
--hub-modal-border-radiusvar(--hub-ref-radius-lg, 0.5rem)length Modal outer border radius
--hub-modal-inner-border-radiuscalc( var(--hub-modal-border-radius, var(--hub-ref-radius-lg, 0.5rem)) - var( --hub-modal-border-width, var(--hub-ref-border-width, 1px) ) )length Inner radius for header/footer caps
--hub-modal-box-shadowvar(--hub-sys-shadow-lg, 0 1rem 3rem rgba(0,0,0,0.175))shadow Modal elevation shadow
--hub-modal-margin-y1.75remlength Vertical margin alias used by top/bottom margin tokens
--hub-modal-margin-xautolength Horizontal margin alias used by left/right margin tokens
--hub-modal-margin-topvar(--hub-modal-margin-y, 1.75rem)length Dialog top margin
--hub-modal-margin-rightvar(--hub-modal-margin-x, auto)length Dialog right margin
--hub-modal-margin-bottomvar(--hub-modal-margin-y, 1.75rem)length Dialog bottom margin
--hub-modal-margin-leftvar(--hub-modal-margin-x, auto)length Dialog left margin
--hub-modal-margin-blockcalc( var(--hub-modal-margin-top, 1.75rem) + var(--hub-modal-margin-bottom, 1.75rem) )length Sum of vertical margins (used for scrollable min-height calc)
--hub-modal-marginvar(--hub-modal-margin-top) var(--hub-modal-margin-right) var(--hub-modal-margin-bottom) var(--hub-modal-margin-left)length Dialog outer margin shorthand
--hub-modal-placement-start-margin-topvar(--hub-modal-margin-top, 1.75rem)length Top margin when placement=start
--hub-modal-placement-start-margin-rightautolength Right margin when placement=start
--hub-modal-placement-start-margin-bottomvar(--hub-modal-margin-bottom, 1.75rem)length Bottom margin when placement=start
--hub-modal-placement-start-margin-left0length Left margin when placement=start (flush to edge)
--hub-modal-placement-start-margin-blockcalc( var(--hub-modal-placement-start-margin-top, 1.75rem) + var(--hub-modal-placement-start-margin-bottom, 1.75rem) )length Sum of vertical margins for start placement
--hub-modal-placement-start-marginvar(--hub-modal-placement-start-margin-top) var(--hub-modal-placement-start-margin-right) var(--hub-modal-placement-start-margin-bottom) var(--hub-modal-placement-start-margin-left)length Margin shorthand for start placement
--hub-modal-placement-start-border-radius0 var(--hub-modal-border-radius, var(--hub-ref-radius-lg, 0.5rem)) var(--hub-modal-border-radius, var(--hub-ref-radius-lg, 0.5rem)) 0length Border radius for start-anchored dialog (right corners rounded)
--hub-modal-placement-end-margin-topvar(--hub-modal-margin-top, 1.75rem)length Top margin when placement=end
--hub-modal-placement-end-margin-right0length Right margin when placement=end (flush to edge)
--hub-modal-placement-end-margin-bottomvar(--hub-modal-margin-bottom, 1.75rem)length Bottom margin when placement=end
--hub-modal-placement-end-margin-leftautolength Left margin when placement=end
--hub-modal-placement-end-margin-blockcalc( var(--hub-modal-placement-end-margin-top, 1.75rem) + var(--hub-modal-placement-end-margin-bottom, 1.75rem) )length Sum of vertical margins for end placement
--hub-modal-placement-end-marginvar(--hub-modal-placement-end-margin-top) var(--hub-modal-placement-end-margin-right) var(--hub-modal-placement-end-margin-bottom) var(--hub-modal-placement-end-margin-left)length Margin shorthand for end placement
--hub-modal-placement-end-border-radiusvar( --hub-modal-border-radius, var(--hub-ref-radius-lg, 0.5rem) ) 0 0 var(--hub-modal-border-radius, var(--hub-ref-radius-lg, 0.5rem))length Border radius for end-anchored dialog (left corners rounded)
--hub-modal-placement-top-margin-top0length Top margin when placement=top (flush to top edge)
--hub-modal-placement-top-margin-rightautolength Right margin when placement=top
--hub-modal-placement-top-margin-bottom0length Bottom margin when placement=top
--hub-modal-placement-top-margin-leftautolength Left margin when placement=top
--hub-modal-placement-top-margin-blockcalc( var(--hub-modal-placement-top-margin-top, 0px) + var(--hub-modal-placement-top-margin-bottom, 0px) )length Sum of vertical margins for top placement
--hub-modal-placement-top-marginvar(--hub-modal-placement-top-margin-top) var(--hub-modal-placement-top-margin-right) var(--hub-modal-placement-top-margin-bottom) var(--hub-modal-placement-top-margin-left)length Margin shorthand for top placement
--hub-modal-placement-top-border-radius0 0 var(--hub-modal-border-radius, var(--hub-ref-radius-lg, 0.5rem)) var(--hub-modal-border-radius, var(--hub-ref-radius-lg, 0.5rem))length Border radius for top-anchored dialog (bottom corners rounded)
--hub-modal-placement-bottom-margin-top0length Top margin when placement=bottom
--hub-modal-placement-bottom-margin-rightautolength Right margin when placement=bottom
--hub-modal-placement-bottom-margin-bottom0length Bottom margin when placement=bottom (flush to bottom edge)
--hub-modal-placement-bottom-margin-leftautolength Left margin when placement=bottom
--hub-modal-placement-bottom-margin-blockcalc( var(--hub-modal-placement-bottom-margin-top, 0px) + var(--hub-modal-placement-bottom-margin-bottom, 0px) )length Sum of vertical margins for bottom placement
--hub-modal-placement-bottom-marginvar(--hub-modal-placement-bottom-margin-top) var(--hub-modal-placement-bottom-margin-right) var(--hub-modal-placement-bottom-margin-bottom) var(--hub-modal-placement-bottom-margin-left)length Margin shorthand for bottom placement
--hub-modal-placement-bottom-border-radiusvar( --hub-modal-border-radius, var(--hub-ref-radius-lg, 0.5rem) ) var(--hub-modal-border-radius, var(--hub-ref-radius-lg, 0.5rem)) 0 0length Border radius for bottom-anchored dialog (top corners rounded)
--hub-modal-header-padding-xvar(--hub-modal-padding-x)length Header horizontal padding
--hub-modal-header-padding-yvar(--hub-modal-padding-y)length Header vertical padding
--hub-modal-header-gapvar(--hub-ref-space-2, 0.5rem)length Header content gap
--hub-modal-header-border-colorvar(--hub-sys-border-color-default, #dee2e6)color Header bottom border color
--hub-modal-header-border-widthvar(--hub-ref-border-width, 1px)length Header bottom border width
--hub-modal-title-font-sizevar(--hub-ref-font-size-lg, 1.25rem)length Modal title font size
--hub-modal-title-font-weightvar(--hub-ref-font-weight-medium, 500)number Modal title font weight
--hub-modal-title-line-heightvar(--hub-ref-line-height-base, 1.5)number Modal title line-height
--hub-modal-title-margin-x0length Title horizontal margin
--hub-modal-title-margin-y0length Title vertical margin
--hub-modal-body-padding-xvar(--hub-modal-padding-x)length Body horizontal padding
--hub-modal-body-padding-yvar(--hub-modal-padding-y)length Body vertical padding
--hub-modal-footer-padding-xvar(--hub-modal-padding-x)length Footer horizontal padding
--hub-modal-footer-padding-yvar(--hub-modal-padding-y)length Footer vertical padding
--hub-modal-footer-gapvar(--hub-ref-space-2, 0.5rem)length Footer actions gap
--hub-modal-footer-bgvar(--hub-modal-bg, var(--hub-sys-surface-page, #ffffff))color Footer background
--hub-modal-footer-border-colorvar(--hub-sys-border-color-default, #dee2e6)color Footer top border color
--hub-modal-footer-border-widthvar(--hub-ref-border-width, 1px)length Footer top border width
--hub-modal-close-colorvar(--hub-sys-text-primary, #212529)color Close button icon color
--hub-modal-close-sizevar(--hub-ref-font-size-lg, 1.25rem)length Close button font-size (controls icon size)
--hub-modal-close-line-height1number Close button line-height
--hub-modal-close-opacity0.5number Close button base opacity
--hub-modal-close-hover-opacity0.75number Close button hover/focus opacity
--hub-modal-backdrop-bgvar(--hub-ref-color-black, #000000)color Backdrop background color
--hub-modal-backdrop-opacityvar(--hub-sys-opacity-50, 0.5)number Backdrop visible opacity
--hub-modal-backdrop-opacity-hiddenvar(--hub-sys-opacity-0, 0)number Backdrop opacity when hidden (before fade-in)
--hub-modal-backdrop-transitionopacity 0.15s lineartransition Backdrop fade transition
--hub-modal-fade-transformtranslate(0, -50px)string Dialog transform at fade start
--hub-modal-show-transformnonestring Dialog transform when shown
--hub-modal-transitionvar(--hub-sys-transition-base, all 0.2s ease-in-out)transition Dialog transition curve/duration
--hub-modal-scale-transformscale(1.02)string Dialog scale in static backdrop bump
--hub-modal-close-padding-x0length Close button horizontal padding
--hub-modal-close-padding-y0length Close button vertical padding
--hub-modal-padding-xvar(--hub-ref-space-3, 1rem)length Dialog body horizontal padding
--hub-modal-padding-yvar(--hub-ref-space-3, 1rem)length Dialog body vertical padding