@hpe-web/components
v1.7.1
Published
HPE Web Design System - Components, Lit web components that consume design tokens as CSS custom properties
Downloads
684
Readme
@hpe-web/components
HPE Design System web components — Lit-based custom elements that consume @hpe-web/design-tokens as CSS custom properties. Framework-agnostic; works in any environment that supports Custom Elements.
Component previews and usage examples are available in Storybook: https://storybook.supernova.io/design-systems/538616/alias/hpe-web-components/index.html
Install
npm install @hpe-web/components @hpe-web/design-tokens@hpe-web/design-tokens is a required peer dependency. It provides all CSS custom properties that the components reference at runtime.
Setup
Load the base token stylesheet in your app's HTML before any components render. Add optional overrides for dark theme, larger viewports, and locales as needed.
<!-- Required: base tokens (xs–sm viewport, light theme) -->
<link
rel="stylesheet"
href="node_modules/@hpe-web/design-tokens/css/tokens.css"
/>
<!-- Optional: dark theme -->
<link
rel="stylesheet"
href="node_modules/@hpe-web/design-tokens/css/tokens.dark.css"
/>
<!-- Optional: md–lg and xl viewport overrides -->
<link
rel="stylesheet"
href="node_modules/@hpe-web/design-tokens/css/tokens.md-lg.css"
/>
<link
rel="stylesheet"
href="node_modules/@hpe-web/design-tokens/css/tokens.xl.css"
/>Dark mode is activated via a data-theme attribute:
<body data-theme="dark">
…
</body>See @hpe-web/design-tokens for the full token reference.
Usage
Looking for React usage? See the React wrapper README.
HTML (via CDN or bundler)
Import the package once in your application entry point. All custom elements self-register on import.
import "@hpe-web/components";Then use the elements directly in HTML:
<hpe-button type="primary">Get started</hpe-button>
<hpe-card>
<hpe-heading slot="heading">Card title</hpe-heading>
<hpe-paragraph>Card body content goes here.</hpe-paragraph>
</hpe-card>ES Modules (named imports)
Import only the classes you need. Each import side-effects the custom element registration.
import { HpeButton, HpeCard } from "@hpe-web/components";Consumer stylesheets
Consumer-facing stylesheets are optional and let teams reuse HPE class contracts on consumer-owned markup. Install the package alongside the required design tokens:
npm install @hpe-web/components @hpe-web/design-tokensImport the full stylesheet bundle:
@import "@hpe-web/components/stylesheets.css";For a single component, import its top-level stylesheet alias:
@import "@hpe-web/components/hpe-button.css";Example class contract:
<button class="hpe-button hpe-button--primary">
<span class="hpe-button__label">Get started</span>
</button>Read the Stylesheets reference for all available imports, class contracts, modifiers, and deep paths.
React wrappers
Install the package with React and React DOM:
npm install @hpe-web/components react react-domImport the wrappers you need from the React entrypoint:
import { HpeButton, HpeCard } from "@hpe-web/components/react";Example wrapper usage:
import { HpeButton, HpeCard } from "@hpe-web/components/react";
export function PromoCard() {
return (
<HpeCard>
<HpeButton type="primary" slot="actions">
Learn more
</HpeButton>
</HpeCard>
);
}Read the React wrapper README for the complete export matrix, event props, slot patterns, and additional React examples.
Server-side rendering (SSR)
This package includes Lit SSR helpers so you can render HPE components to HTML on the server and hydrate on the client.
Server entrypoint:
import { html, render, collectResultSync } from "@hpe-web/components/ssr";
const result = render(html`
<hpe-card>
<hpe-heading slot="heading">SSR title</hpe-heading>
<hpe-paragraph>Rendered on the server.</hpe-paragraph>
</hpe-card>
`);
const ssrMarkup = collectResultSync(result);Client hydration entrypoint (import this before component bundles):
import "@hpe-web/components/ssr-client";
import "@hpe-web/components";This follows Lit's SSR guidance for declarative shadow DOM rendering with optional hydration support.
Components
Elements
Atomic, reusable components.
| Custom element | Exported class(es) | Description |
| -------------------------------------------------------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------ |
| hpe-accordion / hpe-accordion-item | HpeAccordion, HpeAccordionItem | Collapsible content panels |
| hpe-agenda / hpe-agenda-row | HpeAgenda, HpeAgendaRow | Structured event or schedule listing |
| hpe-button | HpeButton | Action button with type, size, and icon variants |
| hpe-button-group | HpeButtonGroup | Grouped set of related buttons |
| hpe-card | HpeCard | Content card container |
| hpe-carousel | HpeCarousel | Horizontally scrollable item carousel |
| hpe-countdown | HpeCountdown | Countdown timer |
| hpe-form | HpeForm | Form wrapper with layout and validation support |
| hpe-horizontal-rule | HpeHorizontalRule | Thematic content divider |
| hpe-image | HpeImage | Responsive image with caption support |
| hpe-input | HpeInput | Text input control |
| hpe-input-group | HpeInputGroup | Labeled input group wrapper |
| hpe-checkbox | HpeCheckbox | Checkbox input control |
| hpe-radio | HpeRadio | Radio input control |
| hpe-select | HpeSelect | Select input control |
| hpe-textarea | HpeTextarea | Multiline text input control |
| hpe-link | HpeLink | Text link with variants and icon controls |
| hpe-link-group | HpeLinkGroup | Grouped set of related links |
| hpe-list / hpe-list-item | HpeList, HpeListItem | Ordered and unordered list |
| hpe-micromodule | HpeMicromodule | Compact media-and-copy module |
| hpe-pricing | HpePricing | Pricing display |
| hpe-progress-bar | HpeProgressBar | Progress indicator |
| hpe-pull-quote | HpePullQuote | Highlighted quotation block |
| hpe-stat / hpe-stat-group | HpeStat, HpeStatGroup | Data statistic and statistic group |
| hpe-tab-group / hpe-tab / hpe-tab-panel | HpeTabGroup, HpeTab, HpeTabPanel | Tabbed content navigation |
| hpe-table | HpeTable, HpeTableHeaderRow, HpeTableHeaderCell, HpeTableBodyRow, HpeTableBodyCell | Data table with semantic row and cell structure |
| hpe-tooltip / hpe-tooltip-plain / hpe-tooltip-rich | HpeTooltip, HpeTooltipPlain, HpeTooltipRich | Plain and rich contextual tooltips |
Foundation
Structural layout primitives. Compose these to build page regions and content grids.
| Custom element | Exported class(es) | Description |
| --------------------------------------------------------- | --------------------------------------------------- | ------------------------------------------------------------ |
| hpe-columns | HpeColumns | Multi-column grid layout |
| hpe-grid | HpeGrid | Responsive grid layout |
| hpe-section | HpeSection | Full-width page section with background and spacing variants |
| hpe-stack | HpeStack | Base stack layout primitive |
| hpe-x-stack / hpe-y-stack | HpeXStack, HpeYStack | Horizontal and vertical stack with gap control |
| hpe-heading / hpe-condensed-heading / hpe-paragraph | HpeHeading, HpeCondensedHeading, HpeParagraph | Typographic text primitives |
Templates
templates/ is preserved in the repository for reference and migration support, but template components are deprecated and no longer exported by @hpe-web/components.
TypeScript
Type definitions are included. The package exports ESM with .d.ts files generated from source.
import type { HpeButton } from "@hpe-web/components";The Custom Elements Manifest (dist/custom-elements.json) is also included for editor tooling and framework integrations that support it.
Requirements
| Requirement | Minimum |
| ------------------------ | ----------------------------------------- |
| Node.js | 18 |
| @hpe-web/design-tokens | 1.1.0 |
| Browsers | Evergreen (Chrome, Firefox, Safari, Edge) |
Releases and changelog
Component package releases use git tags in this format:
components-vX.Y.Z
Before creating a new component tag:
- Update
packages/components/package.jsonversion. - Add a new release section to
packages/components/CHANGELOG.md. - Create the matching tag (
components-vX.Y.Z) after merge.
Historical and future component release notes are tracked in: packages/components/CHANGELOG.md
Release prep note for 1.6.0: this cycle includes documentation improvements for React wrappers, including a dedicated React wrapper README matrix and slot-based usage examples.
