@brightspace-ui/core

中文文档
3.340.0发布于 2026/11/06Apache-2.0ES Module近 30 天下载 2万

A collection of accessible, free, open-source web components for building Brightspace applications

原始使用文档
文档目录8 节
  1. Installation
  2. README Index
  3. Developing
  4. Running the demos
  5. Linting
  6. Testing
  7. Versioning and Releasing
  8. Future Enhancements

Are you a D2L employee? Use our 🎉 Daylight Design System site!

@brightspace-ui/core

NPM version NPM downloads

A collection of accessible, free, open-source web components and tools for building Brightspace applications.

Installation

npm install @brightspace-ui/core

README Index

  • Components
    • Alert: alert components for displaying important information
    • Breadcrumbs: component to help users understand where they are within an application
    • Backdrop: component for displaying backdrop behind a target element
    • Buttons: normal, primary, icon, subtle, and toggle buttons
    • Calendar: calendar component
    • Card: card components
    • Colors: color palette
    • Dialogs: generic and confirmation dialogs
    • Dropdowns: dropdown openers and content containers
    • Expand Collapse: component to create expandable and collapsible content
    • Filter: single or multi-dimensional filter component
    • Focus Trap: generic container that traps focus
    • Forms: aggregate data for submission and validation
    • Hierarchical View: nested container component that shows the active container
    • HTML Block: component for rendering user-authored HTML
    • Icons: iconography SVGs and web components
    • Inputs:
    • Links: link component and styles
    • List: list and list-item components
    • Loading Spinner: loading-spinner components
    • Menu: menu and menu item components
    • Meter: linear, radial, circle meter web components
    • More/less: constrain long bits of content
    • Off-screen: component and styles for positioning content off-screen
    • Selection: components for selection and bulk actions
    • Scroll Wrapper: arrows to scroll content horizontally
    • Skeleton: apply low-fidelity skeletons to your application as it loads
    • Skip Nav: components for skipping past navigation panels
    • Sort: menu for adjusting the sort order of data in a list
    • Status Indicator: status-indicator components
    • Switch: switch component with on/off semantics
    • Table: table styles, column sorting and overflow handling
    • Tabs: tab and tab-panel components
    • Tag List: tag-list and tag-list-item components
    • Tooltip: tooltip components
    • Typography: typography styles and components
    • Validation: plugin custom validation logic to native and custom form elements
  • Controllers
    • Subscriber: for managing a registry of subscribers in a many-to-many relationship
  • Directives
    • Animate: animate showing, hiding and removal of elements
  • Helpers
    • Helpers: helpers for composed DOM, unique ids, etc.
  • Mixins
  • Templates

Developing

After cloning the repo, run npm install to install dependencies.

Run npm run build once, or any time icon files are changed.

Running the demos

Start a @web/dev-server that hosts the demo pages:

npm start

D2L employees can also view the latest main-branch demos at https://live.d2l.dev/BrightspaceUI/core/.

Linting

# eslint and stylelint
npm run lint

# eslint only
npm run lint:eslint

# stylelint only
npm run lint:style

Testing

To run the full suite of tests:

npm test

Alternatively, tests can be selectively run:

# unit tests
npm run test:unit

# aXe accessibility tests
npm run test:axe

# translations tests
npm run test:translations

Note: The axe tests require prefers-reduced-motion emulation to be turned on in the dev console if debugging in a local browser.

This repo uses @brightspace-ui/testing's vdiff command to perform visual regression testing:

# vdiff
npm run test:vdiff

# re-generate goldens
npm run test:vdiff -- --golden

Versioning and Releasing

This repo is configured to use semantic-release. Commits prefixed with fix: and feat: will trigger patch and minor releases when merged to main.

To learn how to create major releases and release from maintenance branches, refer to the semantic-release GitHub Action documentation.

Future Enhancements

Looking for a new component or an enhancement not listed here? Create a GitHub issue!

版本与发布记录

@brightspace-ui/core 共发布 2,137 个版本,首次发布于 2019/07/10;过去 12 个月发布了 375 个版本。

版本发布日期距今
3.340.0latest2026/11/063 天前
3.339.02026/11/053 天前
3.338.22026/11/035 天前
3.338.12026/11/026 天前
3.338.02026/10/309 天前
3.337.02026/10/2910 天前

其他发布通道:release-1.59.x → 1.59.8,release-1.72.x → 1.72.7,release-1.78.x → 1.78.2,release-1.85.x → 1.85.5,release-1.100.x → 1.100.4,release-1.111.x → 1.111.2。

关于 @brightspace-ui/core 的常见问题

@brightspace-ui/core 是什么?

A collection of accessible, free, open-source web components for building Brightspace applications

如何安装 @brightspace-ui/core?

在项目目录运行 npm install @brightspace-ui/core,或使用 pnpm add / yarn add / bun add。

@brightspace-ui/core 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/brightspace-ui__core 是否存在。

@brightspace-ui/core 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@brightspace-ui/core 可以商用吗?

@brightspace-ui/core 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@brightspace-ui/core 的下载量有多少?

根据 npm 官方下载统计,@brightspace-ui/core 在 2026/10/09 – 2026/11/07 这 30 天内被下载 20,113 次,日均约 670 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@brightspace-ui/core 还在维护吗?

最新版本 3.340.0 发布于 2026/11/06(3 天前);至今共发布 2137 个版本,其中过去 12 个月发布了 375 个;首次发布于 2019/07/10。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。