Angular Kanban 看板组件 | ng-hub-ui-board

Angular Kanban 看板组件,支持拖放、自定义卡片模板、列工作流和 CSS 变量,适用于业务仪表盘。

样式

混入与样式

Override any of the `--hub-board-*` 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-board-theme
To Do
Research

Analyze requirements

Design

Create UI mockups

In Progress
Development

Implement core features

Done
Release

Ship to production

Press Space or Enter to grab the card, use the arrow keys to move it, Space or Enter to drop it, Escape to cancel the move.
混入参数描述
Theming
hub-board-theme()
$accent--hub-board-accent
$container-bg--hub-board-container-bg
$container-color--hub-board-container-color
$border-color--hub-board-border-color
$border-radius--hub-board-border-radius
$columns-gap--hub-board-columns-gap
$column-bg--hub-board-column-bg
$column-color--hub-board-column-color
$column-border-color--hub-board-column-border-color
$column-border-radius--hub-board-column-border-radius
$column-width--hub-board-column-width
$column-header-bg--hub-board-column-header-bg
$column-header-color--hub-board-column-header-color
$card-bg--hub-board-card-bg
$card-color--hub-board-card-color
$card-border-color--hub-board-card-border-color
$card-border-radius--hub-board-card-border-radius
$card-padding-x--hub-board-card-padding-x
$card-padding-y--hub-board-card-padding-y
$card-shadow--hub-board-card-box-shadow
One-call theming for `<hub-board>` (Kanban board)

CSS 变量

用 72 个 CSS 变量为每一个像素设置主题。在 :root 处覆盖它们,或将其限定到某个容器范围内。

Board

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-board-container-colorvar(--hub-sys-text-primary, #212529)color Board text color
--hub-board-container-bgvar(--hub-sys-surface-page, #fff)color Board background
--hub-board-border-widthvar(--hub-ref-border-width, 1px)length Base border width shared by columns and cards
--hub-board-border-colorvar(--hub-sys-border-color-default, #dee2e6)color Base border color shared by columns and cards
--hub-board-border-radiusvar(--hub-ref-radius-md, 0.375rem)length Base border radius shared by columns and cards
--hub-board-columns-gapvar(--hub-ref-space-3, 1rem)number 列之间的间距
--hub-board-column-width256pxlength Column width
--hub-board-column-min-height200pxlength Column minimum height
--hub-board-column-body-min-height128pxlength Column body minimum height
--hub-board-column-body-gapvar(--hub-ref-space-3, 1rem)length Gap between cards in a column
--hub-board-column-spacer-y0.75remlength Base vertical spacer for column sections
--hub-board-column-spacer-xvar(--hub-ref-space-3, 1rem)string Base horizontal spacer for column sections
--hub-board-column-border-widthvar(--hub-board-border-width)length 列边框的宽度
--hub-board-column-border-colorvar(--hub-board-border-color)color board 列周围的边框颜色
--hub-board-column-border-radiusvar(--hub-board-border-radius)length 列圆角的边框半径
--hub-board-column-box-shadownoneshadow Column box shadow
--hub-board-column-inner-border-radiusvar(--hub-board-border-radius)length Inner radius for column header/footer
--hub-board-column-cap-padding-yvar(--hub-ref-space-2, 0.5rem)length 列头部和底部内的垂直内边距
--hub-board-column-cap-padding-xvar(--hub-ref-space-3, 1rem)length 列头部和底部内的水平内边距
--hub-board-column-cap-bgvar(--hub-sys-surface-elevated, #f8f9fa)color 列头的背景颜色
--hub-board-column-cap-colorinheritcolor 列头的文本颜色
--hub-board-column-header-padding-yvar(--hub-board-column-cap-padding-y)length Column header vertical padding
--hub-board-column-header-padding-xvar(--hub-board-column-cap-padding-x)length Column header horizontal padding
--hub-board-column-header-bgvar(--hub-board-column-cap-bg)color Column header background
--hub-board-column-header-colorvar(--hub-board-column-cap-color)color Column header text color
--hub-board-column-footer-padding-yvar(--hub-board-column-cap-padding-y)length Column footer vertical padding
--hub-board-column-footer-padding-xvar(--hub-board-column-cap-padding-x)length Column footer horizontal padding
--hub-board-column-footer-bgvar(--hub-board-column-cap-bg)color Column footer background
--hub-board-column-footer-colorvar(--hub-board-column-cap-color)color Column footer text color
--hub-board-column-body-padding-yvar(--hub-board-column-spacer-y)length 列主体(容纳卡片的区域)的垂直内边距
--hub-board-column-body-padding-xvar(--hub-board-column-spacer-x)length 列主体(容纳卡片的区域)的水平内边距
--hub-board-column-header-title-colorinheritcolor Column header title color
--hub-board-column-header-title-spacer-yvar(--hub-ref-space-2, 0.5rem)string Column header title bottom spacing
--hub-board-column-header-subtitle-colorvar(--hub-sys-text-muted, #6c757d)color Column header subtitle color
--hub-board-column-height100%length Column height
--hub-board-column-colorvar(--hub-board-container-color)color board 列内的文本颜色
--hub-board-column-bgvar(--hub-board-container-bg)color board 列的背景颜色
--hub-board-card-spacer-y0.75remlength Base vertical spacer for card sections
--hub-board-card-spacer-xvar(--hub-ref-space-3, 1rem)string Base horizontal spacer for card sections
--hub-board-card-title-spacer-yvar(--hub-ref-space-2, 0.5rem)string Card title bottom spacing
--hub-board-card-title-colorinheritcolor Card title color
--hub-board-card-subtitle-colorvar(--hub-sys-text-muted, #6c757d)color Card subtitle color
--hub-board-card-border-widthvar(--hub-board-border-width)length 卡片边框的宽度
--hub-board-card-border-colorvar(--hub-board-border-color)color 卡片边框的颜色
--hub-board-card-border-radiusvar(--hub-board-border-radius)length 卡片圆角的边框半径
--hub-board-card-box-shadownoneshadow 卡片的阴影
--hub-board-card-inner-border-radiuscalc(var(--hub-board-card-border-radius) - var(--hub-board-card-border-width))length Inner card border radius
--hub-board-card-cap-padding-yvar(--hub-ref-space-2, 0.5rem)length Card cap shared vertical padding
--hub-board-card-cap-padding-xvar(--hub-ref-space-3, 1rem)length Card cap shared horizontal padding
--hub-board-card-cap-bgvar(--hub-sys-surface-elevated, #f8f9fa)color Card cap shared background
--hub-board-card-cap-colorinheritcolor Card cap shared text color
--hub-board-card-padding-yvar(--hub-board-card-spacer-y)length 卡片内部的垂直内边距
--hub-board-card-padding-xvar(--hub-board-card-spacer-x)length 卡片内部的水平内边距
--hub-board-card-header-padding-yvar(--hub-board-card-cap-padding-y)length Card header vertical padding
--hub-board-card-header-padding-xvar(--hub-board-card-cap-padding-x)length Card header horizontal padding
--hub-board-card-header-bgvar(--hub-board-card-cap-bg)color Card header background
--hub-board-card-header-colorvar(--hub-board-card-cap-color)color Card header text color
--hub-board-card-footer-padding-yvar(--hub-board-card-cap-padding-y)length Card footer vertical padding
--hub-board-card-footer-padding-xvar(--hub-board-card-cap-padding-x)length Card footer horizontal padding
--hub-board-card-footer-bgvar(--hub-board-card-cap-bg)color Card footer background
--hub-board-card-footer-colorvar(--hub-board-card-cap-color)color Card footer text color
--hub-board-card-heightautolength Card height
--hub-board-card-colorvar(--hub-board-container-color)color 卡片的文本颜色
--hub-board-card-bgvar(--hub-board-container-bg)color 卡片的背景颜色
--hub-board-drag-transitiontransform 250ms cubic-bezier(0, 0, 0.2, 1)transition 拖放期间应用于卡片的 CSS 过渡(属性、时长和缓动合为一个值)
--hub-board-accentvar(--hub-sys-color-primary, #0d6efd)color Semantic accent — re-based per variant; drives the drop placeholder
--hub-board-accent-subtlecolor-mix(in oklch, var(--hub-board-accent) 12%, var(--hub-sys-surface-page, #fff))color Soft accent tint for the placeholder background
--hub-board-placeholder-border-colorvar(--hub-board-accent)color 拖放占位符的边框颜色
--hub-board-placeholder-border-width2pxlength 拖放占位符的边框宽度
--hub-board-placeholder-border-styledashedborder Drop placeholder border style
--hub-board-placeholder-bgvar(--hub-board-accent-subtle)color 活动放置区域的背景颜色
--hub-board-placeholder-min-height60pxlength Drop placeholder minimum height