@patternfly/pfe-datetime

Datetime element for PFElements

Usage no npm install needed!

<script type="module">
  import patternflyPfeDatetime from 'https://cdn.skypack.dev/@patternfly/pfe-datetime';
</script>

README

PatternFly Elements Netlify status build status commit latest version contributors

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 dev # spin up a local dev server

Additional dependencies

Hub

If you will be doing any release work, it is recommended that you install Hub.

To install on a MacOS: brew install hub.

For other systems, please see documentation: - Hub

Note: You will need to use Node v12 or higher.

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

# Build one or more components
npm run build -w @patternfly/pfe-band -w @patternfly/pfe-bard

Preview

Runs server process to preview files (does not build)

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/pfe-accordion/test/pfe-accordion.spec.ts

# Or multiple:
npm run test:watch -- --files 'elements/pfe-{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

Open a new pull request

# Open a new pull request
npm run pr

Documentation site

View the documentation locally

npm run start:docs

Build the documentation site

npm run build:docs

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