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 are styled with utility classes and semantic CSS variables. Moraine provides setup for UnoCSS and Tailwind CSS.

Moraine is pre-1.0; breaking changes may occur.

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 opens with a Playground, followed by Anatomy (the component structure and slot tree) and Usage (when to use the component, with copyable code). Usage contains only text and code, so agents can learn the API from it. Examples are real tasks with live previews, and their source doubles as a copy-paste guide. The generated API reference lists attributes and props from the library source.

Components such as Button, Input, and Select use a single JSX entry point. Components such as Dialog and Card expose attached parts that you arrange yourself. Read Composition for parts, slots, and DOM ownership, and Polymorphism before changing a rendered element with as.

Adapt the styles#

Use the class and object style props for local changes. Use slot classes and styles where the component exposes them, or scope shared recipe overrides with defineTheme() and MoraineProvider. Start with Customization, then read Theming for shared overrides and Design tokens for colors, spacing, and dimensions.

Integrate behavior#

Use Form for schema validation and submission, or Field for standalone labels and messages. The Accessibility guide explains naming and focus responsibilities; the SSR guide covers initial state, IDs, and browser-only content.