NUMU Docs
Contact
APIThemes
Partner Apps
APIThemes
Partner Apps
  1. CLI & Vite plugin
  • 🗂️ Themes overview
  • 🚀 Start here
  • Glossary
  • Theme engine
    • Architecture
    • BYOT contract
    • Customizer
    • Federation runtime
    • Page data contract
    • Theme manifest
  • Theme SDK
    • Components
    • Federation helpers
    • Hooks
    • SDK overview
    • Type definitions
  • CLI & Vite plugin
    • CLI commands
    • CLI overview
    • Lint rules
    • Section library
    • Vite plugin
  • Storefront host
    • API proxies
    • Built-in fallbacks
    • BYOT fork
    • Routing
    • Storefront overview
  1. CLI & Vite plugin

Section library

15 production-grade section templates bundled with the CLI. Use them as starting points or for quick prototypes.

List the catalog#

Add one to your theme#

For example:
Result:
1.
Writes src/sections/HomepageHero.tsx with the library's component code
2.
Writes schemas/sections/homepage-hero.json (the library's schema, with its type field renamed to your slug)
3.
Best-effort wires the import + dispatch in src/main.tsx
4.
Appends a default instance to theme.json's home preset
After: edit the files freely. The library entry is a snapshot — there's no live link, no version bumps to track.

The 15 entries#

Hero + landing#

hero-with-cta#

Full-bleed hero. Headline + subtitle + 2 CTAs + background image. Bilingual labels. Alignment + overlay opacity settings.

featured-products#

Uses <ProductCard> + useProducts({ limit }). Heading + grid (2–6 cols responsive).

image-with-text#

2-column layout. Image left or right (toggle). Heading, body, CTA. Stacks on mobile.

multi-column#

2/3/4-column grid with reorderable blocks. Each block is a Heading + Image + Paragraph + Link card.

Trust + conversion#

testimonials#

Customer-review grid. Each block: avatar, name, role, body, rating. Bilingual quotes via locale files.

logo-cloud#

Grayscale partner-logo strip. Hover restores color. Up to 12 logos.

newsletter-signup#

Email-capture form with consent checkbox. Posts to /api/customer/newsletter/subscribe. Inline success state, double-opt-in optional.

countdown-timer#

DD:HH:MM:SS countdown to an ISO target. Auto-hides when expired (configurable: hide vs show "ended" message).

Content#

rich-text#

Wraps <RichText> from the SDK. Sanitized HTML body, alignment, max-width. Most flexible content section.

faq-accordion#

Native <details>/<summary> for zero-JS expand. Each block: question, answer.

featured-blog-posts#

3-up article grid powered by useNavigation() + a blog handle.

Commerce-specific#

collection-list#

Uses <CollectionCard> + useCollections({ limit }). Same shape as featured-products but for categories.

announcement-bar#

Dismissible top-of-page promo strip. SessionStorage-backed dismissal. Optional inline link.

Layout#

video-embed#

YouTube or Vimeo <iframe>, or raw <video> with mp4. Lazy-loaded, with thumbnail-first poster.

contact-map#

Address + phone + opening hours block + Google Maps embed iframe. Bilingual labels.

Entry anatomy#

Each library entry lives at numu-theme-cli/src/section-library/entries/<slug>.ts:
import type { SectionLibraryEntry } from "../index";

export const heroWithCta: SectionLibraryEntry = {
  slug: "hero-with-cta",
  name: "Hero with CTA",
  description: "Full-bleed hero with headline + subtitle + 2 CTAs",
  component: `
    import type { SectionProps } from "@numueg/theme-sdk";
    export default function HeroWithCTA({ settings }: SectionProps) {
      // ... full implementation, self-contained
    }
  `,
  schema: {
    type: "hero-with-cta",
    name: "Hero with CTA",
    locales: { ar: { name: "البانر الرئيسي" } },
    settings: [
      { type: "text", id: "headline", label: "Headline", default: "..." },
      // ...
    ],
    blocks: [],
    presets: [],
  },
};
The component is stored as a template string so it can be written verbatim to the new theme. No build step, no compilation — what you see in the entry is what lands in the theme.

Why self-contained#

Library entries never import shared utilities from each other. Each one is fully independent so:
A theme dev can pull one in, modify it freely, and not worry about hidden dependencies
Updates to the library don't ripple into already-installed entries (deliberate — themes diverge after copying)
Cross-entry consistency is loose by design — bring your own design system, the library is just starting points

Adding a new entry (platform devs)#

To add a 16th entry:
1.
Create numu-theme-cli/src/section-library/entries/<slug>.ts. Follow the existing shape — slug, name, description, component, schema.
2.
Register it in src/section-library/index.ts's LIBRARY array.
3.
Test with numu-theme add-section test-x --from-library <slug> against a scratch theme. Run numu-theme dev and verify the section renders + the settings appear in the customizer.
4.
Update this page with the entry.
5.
PR.
Constraints:
Component must use SDK-only imports (no third-party libs in the template — themes can add lodash etc. themselves)
Component must be a default export named after the Pascal-cased slug
Schema's type must equal the slug (the CLI renames it when adding to a theme, so this is just the default)
Bilingual labels via schema.locales.ar at minimum (we ship MENA-first)
Modified at 2026-09-19 15:52:50
Previous
Lint rules
Next
Vite plugin
Built with