Introducing a new way to review your PRs.

Read the announcement

spartan-ng / spartan

Cutting-edge tools powering Angular full-stack development.

View on GitHub

18 documents · Updated Nov 23, 2026

docs / helm-layout-and-data-display

Helm layout and data-display components

Helm layout and data-display components give Angular pages a shared way to arrange content, show records, present status, and guide attention. They cover structural surfaces such as cards and items, data views such as tables and charts, text styles, identity markers, and clear loading or empty states. See Helm components for the full Helm family and Helm form and navigation components for controls, menus, and route movement.

Display component model

Display components provide visual roles rather than business rules. An application supplies the content and state, then combines small Helm parts to express a page section, record, message, or status without creating a new visual pattern for each screen.

Feature entry points

Each display family has its own import path under @spartan-ng/helm. The family entry point exports its parts and usually provides an *Imports bundle for standalone Angular components. The package root is not the display API, so consumers select the family that matches the page role.

References: libs/…/index.ts• L1-2 libs/…/index.ts• L1-25 libs/…/index.ts• L1-25 libs/…/index.ts• L1-40

Composable surfaces

Most display surfaces have a root and named content areas. This lets a page place a title, description, main content, action area, media, or footer where it belongs while keeping the visual relationship clear. The same approach supports both a complete card and a small list item.

References: libs/…/index.ts• L1-25 libs/…/index.ts• L1-35 libs/…/index.ts• L1-22

Page structure

Page structure components group content and control its shape. They help a page keep stable proportions, readable boundaries, and usable scrolling as the viewport or content size changes.

Cards

Cards present one related unit of content as a distinct surface. A card can contain a header with a title and description, a main content area, an action area, and a footer. Its size can vary by context, so the same content model can support compact and larger page sections.

References: libs/…/hlm-card.ts• L5-19 libs/…/hlm-card-header.ts• L4-16 libs/…/hlm-card-title.ts• L4-12 libs/…/hlm-card-description.ts• L4-12 libs/…/hlm-card-content.ts• L4-12 libs/…/hlm-card-action.ts• L4-12 libs/…/hlm-card-footer.ts• L4-12

Items

Items present a row or compact content unit with a consistent place for media, text, actions, and supporting content. Item groups and separators let a page turn related records into a readable list without making each row a separate layout design. Variants and sizes allow the same information pattern to fit different levels of emphasis.

References: libs/…/index.ts• L1-35 libs/…/hlm-item.ts• L6-45

Aspect ratios

Aspect-ratio surfaces keep media or other content inside a predictable width-to-height shape. They accept a numeric ratio or a divided value such as 16/9, which makes image, video, and preview areas stable before their content is ready.

References: libs/…/hlm-aspect-ratio.ts• L5-34

Scroll areas

Scroll areas give a bounded region its own styled scrolling behavior. They are useful when a table, list, preview, or other content must remain inside a page section instead of expanding the whole page.

References: libs/…/hlm-scroll-area.ts• L5-20

Separators

Separators mark a visual boundary between related areas. They support horizontal and vertical orientation, which lets the same visual cue divide stacked sections, columns, list items, or card regions.

References: libs/…/hlm-separator.ts• L5-18

Data presentation

Data presentation components turn structured values into surfaces that users can scan. Tables support strict row and column data, charts support visual trends, while cards and items support records that need more flexible grouping or emphasis.

Tables

Tables provide a styled semantic table model with a container, caption, header, body, footer, row, head cell, and data cell. The surrounding application owns the data, ordering, sorting, filtering, and paging; the Helm table gives those values a consistent visual frame.

References: libs/…/hlm-table.ts• L1-132

Charts

Charts present data as a visual series inside the shared Helm color and surface system. The chart surface supplies the visual context for a TanStack chart, while the surrounding application remains responsible for the data and the meaning of each series.

References: libs/…/hlm-chart.ts• L1-28

Record surfaces

Cards and items are the main alternatives when a record does not fit a dense grid. A card gives the record a full content boundary, while an item supports a compact row with optional media and actions. This distinction helps a page keep the same data readable across dashboard, list, and detail contexts.

References: libs/…/index.ts• L1-25 libs/…/index.ts• L1-35

Messages and bubbles

Messages and bubbles present conversation-like or event-like content. A message groups an avatar, header, content, and footer, while a bubble expresses the content block and its start or end alignment. Variants allow the visual treatment to show different message roles or states.

References: libs/…/index.ts• L1-22 libs/…/hlm-message.ts• L4-20 libs/…/index.ts• L1-11 libs/…/hlm-bubble.ts• L5-45

Typography

Typography components give page content a shared hierarchy and tone. They style headings, body text, supporting text, code, lists, and quotations without forcing the application to replace the semantic HTML element or invent local text classes.

Text hierarchy

Heading styles cover levels one through four. Supporting styles cover lead text, large and small emphasis, muted text, paragraphs, lists, block quotes, and inline code. The application still chooses the correct semantic element and applies the matching Helm directive to keep meaning and appearance aligned.

References: libs/…/hlm-h1.ts• L4-13 libs/…/hlm-h2.ts• L4-14 libs/…/hlm-h3.ts• L4-13 libs/…/hlm-h4.ts• L4-13 libs/…/hlm-lead.ts• L4-13 libs/…/hlm-large.ts• L4-13 libs/…/hlm-small.ts• L4-13 libs/…/hlm-muted.ts• L4-13 libs/…/hlm-p.ts• L4-13 libs/…/hlm-ul.ts• L4-13

Code and long-form content

Code styles distinguish short code values from normal prose. List, block quote, paragraph, and heading styles provide the basic visual grammar for documentation and other long-form content. Together they help a page show structure without coupling the content to one screen layout.

References: libs/…/hlm-code.ts• L4-13 libs/…/hlm-ul.ts• L4-13 libs/…/hlm-blockquote.ts• L4-13

Identity and status markers

Identity and status markers add small, high-value signals to a record or page section. They should support the main content by showing who or what it represents and by making state visible at a glance.

Avatars

Avatars show an image when it is available and a fallback when it is not. They can also show a badge or group several identities with a count, which makes them useful for people, teams, ownership, and participation views.

References: libs/…/index.ts• L1-22 libs/…/hlm-avatar.ts• L5-30

Badges

Badges label a short state, category, or count beside related content. Their variants provide distinct levels of emphasis, including default, secondary, destructive, outline, ghost, and link treatments.

References: libs/…/hlm-badge.ts• L5-40

Markers

Markers attach a small icon or content label to a visual point. They support compact annotations where a badge or full message would take too much space.

References: libs/…/index.ts• L1-9

Loading and absence states

Loading and absence states explain why a view is not showing its final data. A clear state prevents an empty page from looking broken and helps users distinguish work in progress from a real lack of content.

Empty states

Empty states describe a view with no useful content at the current time. The root centers the state, while media, title, description, and content parts can explain the cause and offer a next action. This makes a no-data result an intentional page state rather than a blank region.

References: libs/…/index.ts• L1-22 libs/…/hlm-empty.ts• L4-13 libs/…/hlm-empty-content.ts• L4-11 libs/…/hlm-empty-media.ts• L5-34

Skeleton loading

Skeletons reserve the shape of content while data is loading. They are useful for page sections whose final layout is known, because the user can see where headings, rows, cards, or media will appear before the real values arrive.

References: libs/…/hlm-skeleton.ts• L4-13

Spinner loading

Spinners show a compact busy state when a whole content shape is not yet known or when a local action is in progress. The component exposes a status role and an accessible label so the motion has a clear meaning for assistive technology.

References: libs/…/hlm-spinner.ts• L6-32

Alerts and progress

Alerts keep important status messages in the page flow. Progress surfaces show measurable work through a value or an indeterminate state, so users can tell the difference between a message about a result and an indicator of ongoing work.

References: libs/…/hlm-alert.ts• L5-31 libs/…/index.ts• L1-7 libs/…/hlm-progress.ts• L5-13 libs/…/hlm-progress-indicator.ts• L6-30

The following flow shows how a data view chooses a display state before it presents its final content.

flowchart TD
    A[Data view] --> B{Data ready?}
    B -->|No| C[Loading state]
    C --> D{Known content shape?}
    D -->|Yes| E[Skeleton]
    D -->|No| F[Spinner]
    B -->|Yes| G{Has records?}
    G -->|No| H[Empty state]
    G -->|Yes| I[Table, chart, card, item, or message surface]
    I --> J[Badges, avatars, and typography]

Media and content sequences

Media and sequence components help a page show visual content without losing structure. They keep repeated content inside a known surface and give the user a stable way to move through it.

Carousels

Carousels present a sequence of slides inside a horizontal or vertical viewport. They track the current slide and available movement, support previous and next controls, and expose a slide display so the page can show where the user is in the sequence.

References: libs/…/index.ts• L1-22 libs/…/hlm-carousel.ts• L17-105

Content boundaries

Aspect ratios, scroll areas, separators, and cards work together as content boundaries. A page can keep media at a stable shape, constrain long data, divide related sections, and give each unit a readable surface without changing the data model.

References: libs/…/hlm-aspect-ratio.ts• L13-34 libs/…/hlm-scroll-area.ts• L5-20 libs/…/hlm-separator.ts• L8-18 libs/…/hlm-card.ts• L5-19

Composition flow

Display composition starts with the information role and then selects the smallest surface that can show it. The application combines the root with its named parts, places live data into the content area, and adds markers or feedback only where they help the user read the state.

  1. Choose a surface for the content shape: table, chart, card, item, message, or carousel.
  2. Add the surface's semantic parts, such as a title, description, media, content, or footer.
  3. Apply typography to create the reading order and emphasis.
  4. Add identity or status markers beside the related content.
  5. Select skeleton, spinner, empty, alert, or progress feedback for non-final data states.

Change checklist

When these files or sections are changed, remember to consider these:

  • When a display family adds or renames a root or named part, keep its *Imports bundle and the expected template composition aligned.
  • When a table part changes its semantic host or state styling, check the container and every header, body, footer, row, and cell role together.
  • When a chart theme contract changes, check the chart data view and its tooltip, crosshair, and series colors together.
  • When an empty or loading state changes, keep the distinction between no data, unknown layout, known layout, and measurable work clear to the page consumer.
  • When typography styles change, check documentation pages and other content that uses exported style constants such as hlmP, hlmH1, and hlmCode.
  • When a marker, badge, or avatar variant changes, review the surfaces that use it to signal ownership, category, count, or status.
  • When a scroll or aspect-ratio contract changes, check the parent surface so bounded data and media do not expand or distort the page layout.

Important failure modes

TriggerConsequenceGuard
Using a table without its semantic header, body, row, and cell rolesUsers lose the structure needed to scan or understand the dataKeep the table parts mapped to their matching table elements
Giving a chart data with colors or labels that do not match its series meaningUsers may read the visual trend as a different measureKeep the chart theme and series definition aligned
Showing an empty state during a requestUsers may think the request returned no recordsRender loading feedback until the data result is known
Using a spinner for a large known layoutThe page gives no preview of where content will appearUse skeletons when the final content shape is known
Omitting an accessible label from a spinnerAssistive technology users cannot tell what the busy signal meansKeep the spinner status label meaningful for its context
Replacing semantic headings or lists with styled generic elementsThe visual hierarchy does not match the document structureKeep the correct HTML meaning and apply the matching typography directive
Letting long content bypass its scroll boundaryA local data view expands or pushes other page content awayPut bounded content inside the intended scroll area
Placing badges or markers without nearby contextA short visual label has no clear subject or meaningKeep each marker adjacent to the record or state it describes

Key files

FileWhy to read it
libs/…/index.tsShows the complete card surface and its named content parts.
libs/…/hlm-card.tsShows the root role for a grouped display surface.
libs/…/index.tsShows the compact record and list composition model.
libs/…/hlm-table.tsShows the semantic table surface and all table roles.
libs/…/hlm-chart.tsShows the chart surface and its shared visual context.
libs/…/index.tsShows the shared text hierarchy and content styles.
libs/…/index.tsShows the parts used to explain and act on a no-data state.
libs/…/hlm-skeleton.tsShows the visual contract for known-shape loading.
libs/…/hlm-spinner.tsShows the compact accessible busy state.
libs/…/hlm-progress.tsShows the progress surface for measured or indeterminate work.
libs/…/index.tsShows image, fallback, group, count, and badge identity parts.
libs/…/hlm-badge.tsShows the shared short-label status surface and variants.
libs/…/hlm-aspect-ratio.tsShows the stable media and preview boundary.
libs/…/hlm-scroll-area.tsShows the bounded scrolling surface.
libs/…/hlm-carousel.tsShows the sequence display and slide state model.
libs/…/index.tsShows the structured conversation or event display surface.
libs/…/hlm-bubble.tsShows aligned and variant message content.