Skip to main content

Introduction

Overview of Moraine, a composable, styled component library for SolidJS.

View as Markdown

Moraine provides styled SolidJS components for forms, navigation, overlays, and content. Components use utility classes and semantic CSS variables, with official integrations for UnoCSS and Tailwind CSS v4.

Set up your application#

  1. Install Moraine in your SolidJS application.
  2. Configure UnoCSS or Tailwind CSS to generate component styles.
  3. Choose a component and copy its Usage example.

Read a component page#

Each component page follows a consistent layout:

  • Playground: Interactive preview for testing variants, states, and slot inspection.
  • Anatomy: Component hierarchy and named style slots (data-slot).
  • Usage: When to choose the component over sibling controls, core behavioral contracts, and a copyable TSX example. Usage contains only text and code, so coding agents can read it directly.
  • Examples: Real task patterns with live previews and copy-ready source code.
  • API Reference: Data attributes and typed props extracted from the library source.

Single components (Button, Input, Select) use one JSX element. Composite components (Dialog, Card, Sidebar) expose attached parts that you arrange in your layout.

Read Composition for parts, slots, and DOM ownership, and Polymorphism before changing a rendered element with as.

Adapt the styles#

  • Pass class and object style for one-off overrides on the root element or part.
  • Pass classes and styles to target internal named slots on an instance.
  • Use defineTheme() with MoraineProvider for application-wide or subtree defaults.

Start with Customization for the 4-layer override hierarchy, then read Theming for shared recipe overrides and Design Tokens for colors, spacing, and dimensions.

Integrate behavior#

  • Use Form for schema validation and submission, or Field for standalone labels, descriptions, and error wiring.
  • Read Accessibility for naming, keyboard navigation, and focus contracts.
  • Read Server-Side Rendering for deterministic IDs, portals, and hydration rules.

AI and coding agent documentation#

Every documentation, component, and hook page has a plain Markdown counterpart built from the same source:

  • Fetch /llms.txt for the full documentation index.
  • Append .md to any route (for example /components/button.md or /hooks/create-copy.md) for plain Markdown with inlined examples and API tables.
  • Request /components/<name>.json for a component’s structured JSON API schema.