An elm-ui implementation of the PatternFly 6 design system.
74 components · 7 layouts · Dark mode · Elm 0.19.1 · Builder pattern
Live Demo — Browse all components interactively (with dark mode toggle).
elm-ui-patternfly brings PatternFly 6's component library to Elm applications built with elm-ui. Every component follows the same builder pattern — construct a base value, pipe modifiers through it, and call toMarkup to get an Element msg. No HTML, no CSS, no class names.
elm install lenards/elm-ui-patternflyEvery component follows the same pattern:
import PF6.Button as Button
import PF6.Badge as Badge
-- Construct → modify → render
Button.primary { label = "Save", onPress = Just Saved }
|> Button.withLargeSize
|> Button.withIcon myIcon
|> Button.toMarkup
Badge.badge 7
|> Badge.withOverflowAt 99
|> Badge.toMarkupAll components produce Element msg values compatible with any elm-ui layout.
PF6.Tokens is the foundation of the component library — all colors, spacing, radii, and font sizes come from it. You can use tokens directly in your own layouts for visual consistency:
import PF6.Tokens as Tokens
Element.el
[ Element.padding Tokens.spacerMd
, Bg.color Tokens.colorBackgroundDefault
, Font.color Tokens.colorText
, Border.rounded Tokens.radiusMd
]
contentKey token groups: color*, spacer*, fontSize*, radius*, fontWeight*.
PF6.Theme provides a theme system with light and dark palettes:
import PF6.Theme as Theme exposing (Mode(..), Theme)
theme = Theme.fromMode model.themeMode -- Light or Dark
Element.el
[ Bg.color (Theme.backgroundDefault theme)
, Font.color (Theme.text theme)
]
contentThe pf6-guide live demo includes a dark mode toggle in the masthead.
PF6.Button — 7 variants (primary, secondary, tertiary, danger, warning, link, plain), 3 sizes, icon supportPF6.Badge — numeric count badge with overflow cap and unread variantPF6.Label — 8 color variants, outline, compact, closable, icon supportPF6.Avatar — user avatar image, 3 sizes, optional borderPF6.Icon — semantic icon wrapper with status colors and 4 sizesPF6.Title — heading levels H1–H6 with PF6 sizingPF6.Divider — horizontal rule with inset variantsPF6.Alert — inline alerts — default, success, danger, warning, info; optional closePF6.Banner — full-width site banners with optional linkPF6.Spinner — animated loading indicator, 4 sizesPF6.Skeleton — loading placeholder — text lines, circle, and square variantsPF6.EmptyState — empty state with icon, title, body, and actionsPF6.Progress — progress bar with status colors and size variantsPF6.HelperText — form field helper text — default, error, warning, success, indeterminatePF6.TextInput — text field with label, placeholder, validation states, disabledPF6.Checkbox — checkbox with label and optional descriptionPF6.Radio — radio button with label and optional descriptionPF6.Switch — toggle switch with on/off labelsPF6.NumberInput — numeric input with increment/decrement, min/max/step, unit suffixPF6.SearchInput — search field with clear, submit, and typeahead hintsPF6.Select — single-select dropdown with option groupsPF6.Form — form layout with labeled groups, required markers, and helper textPF6.Breadcrumb — breadcrumb trail with linked and current-page itemsPF6.Tabs — tab navigation — default, box, vertical, and filled variantsPF6.Pagination — page navigation with item count and compact variantPF6.Card — content card with title, footer, flat, compact, and selectable variantsPF6.Page — page shell with masthead, sidebar, and main content areaPF6.Drawer — sliding panel — right, left, or bottom; inline or overlay modePF6.Modal — full-viewport modal dialog with title, body, footer, and size variantsPF6.Tooltip — hover tooltip — top, bottom, left, right positioningPF6.Popover — click-triggered overlay with title, body, footer, and close buttonPF6.Dropdown — action dropdown with dividers, headers, and position controlPF6.Accordion — expandable content sections with bordered and large-display variantsPF6.ExpandableSection — single toggle-show/hide content blockPF6.CodeBlock — read-only code display with expandable variantPF6.ClipboardCopy — copy-to-clipboard with inline and block variantsPF6.List — bulleted, ordered, plain, and inline list variantsPF6.DescriptionList — term/value pairs — vertical and horizontal layoutsPF6.ActionList — spaced group of action buttonsPF6.Table — data table with sortable columns, striped rows, compact, and bordered variantsPF6.DataList — flexible list with checkable rows and expandable contentPF6.Toolbar — filter/sort toolbar with item groups, separator, and item countPF6.BackToTop — floating scroll-to-top buttonPF6.Backdrop — semi-transparent overlay backgroundPF6.Brand — logo/brand image with responsive sizingPF6.Hint — contextual hint with lighter styling than AlertPF6.InputGroup — groups form controls with shared bordersPF6.JumpLinks — in-page anchor navigation with subsectionsPF6.Masthead — top header bar with brand, content, and toolbar slotsPF6.Menu — generic menu with items, dividers, headers, and searchPF6.Navigation — vertical/horizontal application navigationPF6.NotificationBadge — bell icon with unread count overlayPF6.NotificationDrawer — slide-out notification panel with variant iconsPF6.Panel — simple bordered container with header/body/footerPF6.ProgressStepper — multi-step progress indicatorPF6.Sidebar — layout container with sidebar panel and content areaPF6.SimpleList — clickable list with selection statePF6.SkipToContent — accessibility skip-nav link, hidden until focusedPF6.Slider — range slider input with PF6 stylingPF6.TextArea — multi-line text input with validation and resizePF6.TextInputGroup — input with prefix/suffix elementsPF6.Tile — selectable card-like option tilesPF6.Timestamp — formatted date/time display with optional iconPF6.ToggleGroup — button group with toggle selectionPF6.Truncate — text truncation with tooltipPF6.Wizard — multi-step form wizard with sidebar navigationPF6.Bullseye — centers content vertically and horizontallyPF6.Flex — configurable flex layout with direction, alignment, gapPF6.Gallery — responsive grid of uniform items with min/max widthsPF6.Grid — 12-column grid system with percentage-based spansPF6.Level — even horizontal distribution of itemsPF6.Split — horizontal layout with fill items and wrappingPF6.Stack — vertical layout with fill itemsPF6.Theme — light and dark mode color token systemPF6.Tokens — static design tokens (light mode defaults)The examples/pf6-guide/ directory contains a full interactive TEA application that demonstrates all 74 components with live state. A live version is deployed automatically to lenards.github.io/elm-ui-patternfly on every push to main.
cd examples/pf6-guide
npm install # install dev tools (first time only)
npm run build # compile Elm → main.js
npm run serve # serve on http://localhost:8001Or if you just want to compile and open directly without a server:
cd examples/pf6-guide
elm make src/Main.elm --output=main.js
open index.htmlNote:
elm reactorwill show a blank page because it doesn't pre-compilemain.js. Usenpm run serveor openindex.htmlafter runningelm make.
The guide is organized into 9 sections matching the component groups above. Every component is shown with multiple variants and real interactive state (forms you can type in, modals you can open, accordions you can expand, etc.).
To run the Playwright tests:
cd examples/pf6-guide
npm testThe test suite compiles the app automatically before running.
Issues and pull requests are welcome. If you find a bug, have a component request, or want to suggest an improvement, please open an issue.