PatternFly Elements

PatternFly Elements:一套基于 PatternFly 设计的社区创建的 web 组件。「PatternFly Elements. A set of community-created web components based on PatternFly design.」

Github星跟踪图

PatternFly Elements

latest version contributors

build status
last commit Netlify status

Table of Contents

  1. Getting started
  2. Element catalog
  3. Creating components
  4. Theming components

PatternFly Elements is a work-in-progress collection of flexible and lightweight Web Components based on the Unified Design Kit. The repo also includes a generator to build new components. PatternFly Elements are:

  • Lightweight: small file size, minimal boilerplate, no "framework-like" features.
  • Universal: write once, use everywhere. PatternFly Elements work in React, Vue, Angular, vanilla JS, anywhere HTML elements are used.
  • Themable: Make overrides as needed via attributes or CSS variables

The result of these principles is that you can plug one set of components into a wide variety of applications; bringing UX consistency and developer familiarity to any web project.

A generator is included for creating web components that meet these goals.

Quick start

git clone git@github.com:patternfly/patternfly-elements.git
cd patternfly-elements
npm ci # install dependencies.
npm run start

Additional dependencies

nvm

Building PatternFly Elements requires specific versions of Node.js. To automate usage of the correct version, it is recommended that contributors install nvm as well an automatic version switcher like avn or shell-specific nvm integration. With those installed, your terminal will automatically switch to the correct Node.js version when you cd into the PatternFly Elements repository.

Command Line Helper Scripts

Many commands have an optional argument of space-separated component name(s), if left off it will assume it should run on all components. These should run from the project root.

Compile

# Build all components
npm run build

Preview

Runs development server.

npm start

Testing

✨ Test using (Web Test Runner)

# Run default test group in watch mode.
npm run test:watch

# Run a single test in watch mode.
npm run test:watch -- --files elements/pf-accordion/test/pf-accordion.spec.ts

# Or multiple:
npm run test:watch -- --files 'elements/pf-{select,card}/test/*.spec.ts'

# Run all tests excluding react and vue tests.
npm run test:watch

# Run all tests using a React wrapper in watch mode.
npm run test:react

# Run all tests using a Vue wrapper in watch mode.
npm run test:vue

# Run all tests with and without React and Vue wrappers.
# This is run on pull request within CI.
npm run test:ci

Development and Documentation servers

# Development and documentation servers load simultaneously on localhost:port `:8000` and `:8080` respectively.
npm run start

Support

Though we have tested and verified general usability within these frameworks, PatternFly Elements makes no guarantees about compatibility within specific sites and applications. Please test accordingly.

Stay informed

Sign up for the for the active project participation email list and/or the informed email list.

You can also participate in discussions on patternfly.slack.com in the #patternfly-elements channel.


home |
start |
develop |
theming |
catalog |
web components

code style: prettier tested with webdriver.io

主要指标

概览
名称与所有者patternfly/patternfly-elements
主编程语言TypeScript
编程语言JavaScript (语言数: 5)
平台Linux, Mac, Windows
许可证MIT License
所有者活动
创建于2018-01-04 20:25:32
推送于2025-06-05 14:51:34
最后一次提交
发布数429
最新版本名称@patternfly/pfe-core@5.0.2 (发布于 2025-05-25 04:44:08)
第一版名称initial (发布于 2018-09-07 15:06:39)
用户参与
星数380
关注者数24
派生数98
提交数3.2k
已启用问题?
问题数926
打开的问题数171
拉请求数1541
打开的拉请求数16
关闭的拉请求数407
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?