Introduction
Overview of Moraine, a composable, styled component library for SolidJS.
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#
- Install Moraine in your SolidJS application.
- Configure UnoCSS or Tailwind CSS to generate component styles.
- 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
classand objectstylefor one-off overrides on the root element or part. - Pass
classesandstylesto target internal named slots on an instance. - Use
defineTheme()withMoraineProviderfor 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.txtfor the full documentation index. - Append
.mdto any route (for example/components/button.mdor/hooks/create-copy.md) for plain Markdown with inlined examples and API tables. - Request
/components/<name>.jsonfor a component’s structured JSON API schema.