UI Library

@macavitymadcap/hyper-dank-ui exposes server-rendered Hono JSX primitives plus a small CSS export. It is for generic structure and HTML contracts, not product-specific screens.

Library docsLibraries

Install

Install from npm with the JSX and type tooling peers:

npm install @macavitymadcap/hyper-dank-ui hono typescript

Package: view on npm.

Import components from server JSX and import the CSS through the browser asset pipeline. Importing a component in server code does not automatically load browser styles.

import { Button, Card, FormField, HxForm, StagedForm, Switch } from "@macavitymadcap/hyper-dank-ui";
import "@macavitymadcap/hyper-dank-ui/styles.css";

export function SettingsForm() {
  return (
    <Card as="section">
      <HxForm action="/settings" method="post" hx-post="/settings" hx-target="#settings-panel">
        <FormField id="display-name" label="Display name" name="displayName" required />
        <Switch id="notifications" label="Notifications" name="notifications" value="enabled" />
        <Button>Save settings</Button>
      </HxForm>
    </Card>
  );
}

The CSS export preserves generic hooks such as .button[data-variant="ghost"], .switch[data-variant="compact"], and .form-field. Product layout and visual identity should layer after the package CSS.

Component API

ExportPurposeDemonstration
AspectRatio, AspectRatioPropsFixed-ratio media/content frame with --aspect-ratio styling hook.Components/Shared/Low State Primitives
Avatar, AvatarPropsCompact user identity image or initials fallback with size hooks.Components/Shared/Low State Primitives
Badge, BadgePropsCompact metadata label with accent, neutral, or warning tone.Components/Shared
Button, ButtonPropsNative button with primary, danger, outline, text, and ghost variants plus optional HTMX attributes.Components/Shared/Button
ButtonGroup, ButtonGroupPropsToolbar-style grouping for related buttons or links.Components/Shared
Card, CardElement, CardPropsSemantic surface rendered as article, div, main, or section, with size custom-property hooks.Components/Shared/Card
Callout, CalloutPropsHighlighted prose block for documentation and product guidance.Components/Shared
CheckboxField, CheckboxFieldPropsLabelled native checkbox with description and error hooks.Components/Shared
Chip, ChipPropsInline status text with optional class hook.Components/Shared/Chip
CodeBlock, CodeBlockPropsEscaped code sample wrapper with optional language class.Components/Shared
Combobox, ComboboxOption, ComboboxPropsLabelled native datalist input for app-owned suggestions and validation.Components/Shared/Core Primitives
Command, CommandItem, CommandPropsSearch landmark and result options for app-owned command filtering and loading.Components/Shared/Core Primitives
Dialog, DialogPropsNative dialog with trigger, close form, fallback content, and HTMX-friendly hooks.Components/Shared
EmptyState, EmptyStatePropsBlank-state region with optional action slot.Components/Shared
Fieldset, FieldsetPropsGrouped native controls with legend, hint, and error copy.Components/Shared
Icon, IconPropsDecorative or labelled icon span with muted, neutral, success, or warning tone.Components/Shared
IconButton, IconButtonPropsIcon-only native button with required accessible label.Components/Shared
Kbd, KbdPropsInline keyboard input hint for shortcuts and command help.Components/Shared/Low State Primitives
LinkButton, LinkButtonPropsLink styled with button variants while preserving normal navigation.Components/Shared
LoadingIndicator, LoadingIndicatorPropsPolite loading status text for async regions.Components/Shared
MetadataList, MetadataListItem, MetadataListPropsDefinition-list metadata rows for compact summaries.Components/Shared
NotificationBanner, NotificationBannerProps, NotificationSeverityPage-level feedback banner with severity roles, shape hooks, and static live-region semantics.Components/Shared/App Surfaces And Feedback
Notice, NoticePropsTonal feedback block with appropriate status or alert semantics.Components/Shared
PageHeader, PageHeaderPropsPage title, description, metadata, and action slots.Components/Shared
Pagination, PaginationPropsLink-backed page navigation with current-state output.Components/Shared
Panel, PanelPropsLabelled section wrapper with default or narrow width.Components/Shared
Progress, ProgressPropsNative progress output with accessible label.Components/Shared
Prose, ProsePropsArticle wrapper for readable documentation or editorial content.Components/Shared
RadioGroup, RadioGroupOption, RadioGroupPropsFieldset-backed radio options with help and error hooks.Components/Shared
SectionHeader, SectionHeaderPropsSection title, optional copy, and action slot.Components/Shared
SegmentedControl, SegmentedControlOption, SegmentedControlPropsRadio-backed mode switcher for mutually exclusive choices.Components/Shared
SelectField, SelectFieldOption, SelectFieldPropsLabelled native select with options, hint, and error hooks.Components/Shared
SideNav, SideNavItem, SideNavPropsLabelled section navigation with current-state output.Components/Shared
StatBlock, StatBlockPropsDefinition-list metric block for dashboard summaries.Components/Shared
StagedForm, StagedFormProps, StagedFormStep, StagedFormStepStatusOrdered multi-stage form layout with current, complete, unavailable, and error step states.Components/Shared/App Surfaces And Feedback
StatusSymbol, StatusSymbolProps, StatusToneInline status marker that pairs label, shape, and severity without relying on colour alone.Components/Shared/App Surfaces And Feedback
StatusSummary, StatusSummaryItem, StatusSummaryPropsDefinition-list status rows for review dashboards.Components/Shared
Switch, SwitchPropsCheckbox-backed icon toggle for themes, preferences, and HTMX-enhanced settings.Components/Shared/Switch
TableFilterSummary, TableFilterSummaryItem, TableFilterSummaryPropsPolite table status region for result counts, active filters, and reset links.Components/Shared/Molecules/ScrollableTable
TableCell, TableCellPropsReusable table cell for string and number values.Components/Shared/TableCell
Tabs, TabItem, TabsPropsLink-backed tabs with current-state semantics.Components/Shared
TextareaField, TextareaFieldPropsLabelled native textarea with hint and error hooks.Components/Shared
TimelineList, TimelineListItem, TimelineListPropsOrdered event list with optional time and metadata.Components/Shared
Toolbar, ToolbarPropsCompact labelled action region for dense screens.Components/Shared
ValidationSummary, ValidationSummaryItem, ValidationSummaryPropsAlert region linking validation messages to form controls.Components/Shared
HtmxPropsShared prop interface for supported hx-* attributes such as hx-post, hx-target, hx-swap, and hx-trigger.Shared form and control stories
Accordion, AccordionItem, AccordionPropsGrouped details disclosure list with optional metadata and controls.Components/Shared/Reusable Patterns
AppShell, AppShellPropsLandmark shell with header, navigation, and main content slots.Components/Shared
BasicGraph, BasicGraphDatum, BasicGraphPropsSmall accessible SVG graph for static dashboard, docs, and content examples.Components/Shared/Reusable Patterns
Breadcrumbs, BreadcrumbItem, BreadcrumbsPropsOrdered breadcrumb navigation for docs and app sections.Components/Shared
CompactList, CompactListItem, CompactListPropsDefinition-list style rows for label, value, metadata, and controls.Components/Shared/Reusable Patterns
FormField, FormFieldPropsLabelled native input wrapper, or a label/control wrapper when children are supplied.Components/Shared/FormField
HxForm, HxFormPropsNative action/method form wrapper that also spreads HTMX attributes for enhanced submissions.Components/Shared/HxForm
InputGroup, InputGroupPropsLabelled input group for compact numeric or text-entry forms.Components/Shared/InputGroup
LabelledOutput, LabelledOutputPropsLabel/value output pair with placeholder behaviour for empty numbers.Components/Shared/LabelledOutput
PopoverMenu, PopoverMenuItem, PopoverMenuPropsButton-controlled menu that can render links or small POST forms.Components/Shared/Reusable Patterns
ScrollableTable, ScrollableTableColumn, ScrollableTablePropsSticky-header, scrollable table shell with responsive column and row sizing hooks.Components/Shared/ScrollableTable
Separator, SeparatorPropsDecorative or semantic separator for grouping dense controls and content.Components/Shared/Low State Primitives
Skeleton, SkeletonPropsLabelled loading placeholder with line, block, and circle shapes.Components/Shared/Low State Primitives
Tooltip, TooltipPropsStatic contextual help with an explicit text label and focusable described trigger.Components/Shared/Low State Primitives

Storybook is the canonical rendered reference. Shared package examples are grouped under Components/Shared, while Walking Pace examples are grouped under Components/Reference App. Individual Storybook examples are published at /storybook/.

Composition Patterns

App ShapeUseful ExportsBoundary
Server appsHxForm, FormField, Button, PanelRoutes, validation, auth, and permissions stay local.
Static blogsCard, Panel, Badge, CompactListContent routing and editorial layout stay local.
DashboardsHxForm, ScrollableTable, TableFilterSummary, TableCell, Badge, PopoverMenu, Command, BasicGraphDomain actions, query construction, sorting, filtering, column preferences, row mutations, live data, analytics rules, and role rules stay local.
Dense formsSelectField, Combobox, PopoverMenu, Command, StagedFormUse native selects for short fixed sets, datalist suggestions for open text, menu actions for compact choices, command search only when the app owns filtering/loading, and staged forms when app routes own sequential step state.
FeedbackStatusSymbol, NotificationBanner, Notice, ValidationSummary, Progress, StatusSummary, BadgeStatus copy, notification timing, toast queues, dismissal, persistence, and escalation rules stay local.
Static demosInputGroup, LabelledOutput, Button, PanelDemo state and calculation logic stay local.

Use HxForm when a control must work as normal HTML first and become fragment-driven when HTMX is available.

<HxForm
  action="/items"
  method="post"
  hx-post="/items"
  hx-target="#items-list"
  hx-swap="outerHTML"
>
  <FormField id="title" label="Title" name="title" required />
  <Button>Add item</Button>
</HxForm>

Staged Forms

Use StagedForm inside HxForm when a long form needs a shared progress list and current-step panel, but the app still owns which steps are available. Steps accept complete, current, available, unavailable, and error states plus optional native href and hx-* attributes. The current panel can compose Fieldset, FormField, ValidationSummary, ButtonGroup, and native submit buttons.

<HxForm action="/articles/new" method="post" hx-post="/articles/new/stage" hx-target="#stages">
  <StagedForm
    id="stages"
    currentStepId="content"
    steps={[
      { id: "basics", label: "Basics", status: "complete", href: "/articles/new?stage=basics" },
      { id: "content", label: "Content", status: "current" },
      { id: "review", label: "Review", status: "unavailable" },
    ]}
    actions={<Button type="submit">Continue</Button>}
  >
    <FormField id="body" label="Body" name="body" />
  </StagedForm>
</HxForm>

Validation rules, dependent-step eligibility, saved data, permissions, and redirects stay in the route or service layer. Branching workflows and client-side wizard engines are deliberately outside the shared UI contract.

BasicGraph

Use BasicGraph when a page needs a small static chart for comparison or trend context. It renders an SVG with role="img", a connected title and description, and a visible caption. The component is for already-prepared values; apps still own analytics queries, aggregation, permissions, live data, and any interactive exploration.

<BasicGraph
  id="content-activity"
  title="Content activity"
  summary="Published content is trending upwards across three review periods."
  kind="line"
  data={[
    { label: "Week 1", value: 8 },
    { label: "Week 2", value: 13 },
    { label: "Week 3", value: 18 },
  ]}
/>

The component accepts kind, data, max, summary, valueFormatter, width, height, and className. Its CSS uses currentColor and --hd-accent, so the graph can follow light, dark, or app-specific themes without changing the JSX contract.

Data Tables

Use ScrollableTable for semantic table markup that needs responsive column tracks, sticky headers, scrollable bodies, loading and empty composition, pagination, and row-action columns. Column metadata can expose sortDirection as aria-sort, while header content can be a normal link to an app-owned sorted route. TableFilterSummary provides a polite summary of result counts, active filters, and reset links.

Hyper-Dank does not sort, filter, persist column preferences, store selected rows, or run mutations. Build those behaviours in the consuming app, then pass the resulting rows, links, labels, and preferences into the shared markup primitives.

Feedback Vocabulary

Use info, success, warning, and danger for page-level notification severity. StatusSymbol also accepts neutral for compact inline metadata. Each marker exposes a shape hook, not only a colour: circle for information, check for success, triangle for warning, octagon for danger, and dot for neutral.

NotificationBanner maps warning and danger to assertive alerts, while info and success remain polite status regions. Use it for page-level events. Use Notice for local panel or form feedback, ValidationSummary for linked form errors, Progress and LoadingIndicator for async work, and StatusSummary or Badge for compact dashboard metadata. Toast-style regions should stay static landmarks in shared markup; client queues, timers, dismissal, stores, and persistence belong in the consuming app.