Helpers

Utilities

Helper classes for spacing, display, visibility, borders, dimensions, text wrapping, and animations.

Display

Display Utilities

Class CSS
display-flex display: flex
display-block display: block
display-inline-block display: inline-block
display-grid display: grid
display-none display: none
display-table display: table
display-table-cell display: table-cell

Flex

Flex Alignment

Use with display-flex to align children along both axes.

Align Items

items-centeralign-items: center
items-startalign-items: flex-start
items-endalign-items: flex-end
items-stretchalign-items: stretch
items-baselinealign-items: baseline

Justify Content

justify-centerjustify-content: center
justify-startjustify-content: flex-start
justify-endjustify-content: flex-end
justify-betweenjustify-content: space-between
justify-aroundjustify-content: space-around

Legacy Alignment Classes

These older alignment classes are also available. The shorter items-* and justify-* classes above are preferred.

fully-centeredFlex center on both axes
horizontally-centeredjustify-content: center
vertically-centered-space-betweenVertical center, space-between
align-centeralign-items: center + text-align center
align-middlealign-items: center
align-baselinealign-items: baseline
align-flex-startalign-items: flex-start
align-flex-endalign-items: flex-end
align-stretchalign-items: stretch
justify-flex-startjustify-content: flex-start
justify-flex-endjustify-content: flex-end
justify-space-betweenjustify-content: space-between
justify-space-aroundjustify-content: space-around
<div class="display-flex items-center justify-between">
  <span>Left</span>
  <span>Right</span>
</div>

<div class="display-flex items-center gap-sm">
  <img src="avatar.jpg" alt="">
  <span>Username</span>
</div>

Position

Position Utilities

Class CSS
fixed position: fixed
absolute position: absolute
relative position: relative
static position: static
sticky position: sticky

Spacing

Margin & Padding

All-Sides Scale

Size Margin Padding
0.25remmargin-xspadding-xs
0.5remmargin-smpadding-sm
0.75rem (default)marginpadding
1.5remmargin-lgpadding-lg
2remmargin-xlpadding-xl
Remove allno-marginno-padding
Remove topno-top-marginno-top-padding
Remove bottomno-bottom-marginno-bottom-padding
Remove all spacingno-spacing

Directional Scale

Works for both margin and padding. Replace * below with either.

Size Top Bottom Left Right
xs (0.25rem) *-top-xs *-bottom-xs *-left-xs *-right-xs
sm (0.5rem) *-top-sm *-bottom-sm *-left-sm *-right-sm
(default) (0.75rem) *-top *-bottom *-left *-right
lg (1.5rem) *-top-lg *-bottom-lg *-left-lg *-right-lg
xl (2rem) *-top-xl *-bottom-xl *-left-xl *-right-xl

Visual Demo

.padding
.padding-top .padding-bottom
.margin

Gap

Gap Utilities

Apply consistent spacing between flex or grid children without margin hacks.

Class Size
gap-xs 0.25rem
gap-sm 0.5rem
gap 0.75rem
gap-lg 1.5rem
gap-xl 2rem

Visual Demo

display-flex + gap-lg

A
B
C
<div class="display-flex gap-lg">
  <div>A</div>
  <div>B</div>
  <div>C</div>
</div>

Borders

Border Utilities

border
border-top
border-bottom
border-left
border-right

Other: no-border, border-radius, circle

Dimensions

Width & Height

Percentage-based width classes: width-10, width-20, width-25, width-33, width-40, width-50, width-66, width-70, width-75, width-80, width-90, width-100.

width-100
width-90
width-80
width-75
width-70
width-66
width-50
width-40
width-33
width-25
width-20
width-10

Height utilities use the same increments: height-100, height-90, height-80, height-75, height-70, height-50, height-33, height-25, height-10.

Responsive width variants: tablet-width-*, phone-width-*, small-desktop-width-*, large-phone-width-*.

Visibility

Show & Hide

Class Effect
hide display: none
sr-only Visually hidden, accessible to screen readers
skip-link Hidden until focused — use as first focusable element in body
hide-on-desktop Hidden on desktop, visible on mobile
hide-on-mobile Hidden on mobile, visible on desktop

Text Wrap

Text Wrap Utilities

Control how text breaks across lines — prevent orphaned words or balance heading line lengths.

Class CSS Use Case
no-orphan text-wrap: pretty Prevents orphaned words on paragraphs
text-balance text-wrap: balance Balances line lengths for headings
nowrap white-space: nowrap Prevents all wrapping

Visual Demo

Without text-balance

This heading demonstrates what happens without balanced text wrapping enabled

With text-balance

This heading demonstrates what happens with balanced text wrapping enabled

<h2 class="text-balance">Balanced heading text</h2>
<p class="no-orphan">Paragraph without orphaned words.</p>

Color

Text Color

Semantic Text Colors

text-primary — Body text color

text-secondary — Secondary text

text-tertiary — Muted text (alias: text-muted)

text-inverse — Inverse color

text-on-color — White text for colored backgrounds

success — Green status text

error — Red status text

Named Colors

color-blue

color-red

color-green

color-yellow

color-black

color-white

Opacity Scales

Black at 10–90% opacity: color-gray-10, color-gray-20, color-gray-30, color-gray-40, color-gray-50, color-gray-60, color-gray-70, color-gray-80, color-gray-90.

White at 10–90% opacity: color-white-10, color-white-20, color-white-30, color-white-40, color-white-50, color-white-60, color-white-70, color-white-80, color-white-90.

Background

Background Utilities

bg-blue
bg-red
bg-green
bg-yellow
bg-surface
bg-glass
bg-blueBlue background, WCAG AA with white text
bg-redRed background, WCAG AA with white text
bg-greenGreen background, WCAG AA with white text
bg-yellowYellow background, WCAG AA with dark text
bg-surfaceSurface background (alias: background-white)
background-blackBlack background
bg-glassFrosted glass with backdrop blur

Elevation

Layers & Shadows

Layer classes (layer-0, layer-1, layer-2, layer-3) combine a background color with a matching shadow for consistent elevation. Shadow classes (shadow-1, shadow-2, shadow-3) apply box-shadow only.

layer-0
layer-1
layer-2
layer-3
shadow-1
shadow-2
shadow-3

Fonts

Font Family

sans — System sans-serif font stack

serif — Georgia serif font family

mono — Monospace font family

Legacy class: code applies inline code styling (prefer the native <code> element).

Cursors

Cursor Utilities

ClassCursor
cursor-pointerPointer hand
cursor-defaultDefault arrow
cursor-textText I-beam
cursor-moveMove crosshair
cursor-not-allowedNot allowed
cursor-helpHelp indicator
cursor-progressLoading spinner
cursor-crosshairCrosshair
cursor-copyCopy indicator
cursor-aliasAlias/shortcut
cursor-cellCell/plus
cursor-context-menuContext menu
cursor-no-dropNo drop
cursor-all-scrollAll-scroll
cursor-noneHidden cursor
cursor-ew-resizeHorizontal resize
cursor-ns-resizeVertical resize
cursor-nesw-resizeDiagonal resize

Also: cursor-n-resize, cursor-e-resize, cursor-s-resize, cursor-w-resize, cursor-ne-resize, cursor-nw-resize, cursor-sw-resize, cursor-se-resize

Components

Component Utilities

Pre-built component classes for common UI patterns. These require JavaScript for interactivity but ply provides all the styling.

Accordion

accordion-titleClickable header
accordion-title-openedOpen state header
accordion-panelContent panel (hidden by default)
accordion-toggleToggle indicator
accordion-toggle-closedPlus icon indicator
accordion-toggle-openedMinus icon indicator

Dropdown

dropdownAbsolute-positioned panel
caretDown-pointing arrow indicator
caret-upUp-pointing arrow indicator

Modal

For most use cases, prefer the native <dialog> element which ply auto-styles. These classes are for custom modal implementations.

modalModal dialog box
modal-boxFull-screen overlay container
modal-blurBlur background content
modal-closeClose button (top-right)

Tooltip

tooltipBase tooltip popup
tooltip-theme-blueBlue tooltip
tooltip-theme-redRed tooltip
tooltip-theme-greenGreen tooltip
tooltip-theme-yellowYellow tooltip
tooltip-theme-whiteWhite tooltip

Loader & Embed

loaderSpinning loader animation
flexible-embed16:9 responsive iframe/video container

Animation

Animation Utilities

spinning

fade-in
<div class="spinning">Loading spinner</div>
<div class="fade-in">Fades in on load</div>

Miscellaneous

Other Utilities

Class Effect
clearfixClear floats
flat-listRemove list bullets and margin
circleborder-radius: 100%
border-radiusStandard border radius (0.25rem)
border-radius-lgLarge border radius (0.75rem)
border-radius-xlExtra large border radius (1.5rem)

Flat List

  • Item one — no bullet
  • Item two — no margin
  • Item three — clean list

Next

Next Steps

Learn about built-in accessibility features, or set up your AI agent to use ply.