Seriph
← Back to docs

@seriphxyz/solid

SolidJS primitives for comments, reactions, forms, and subscriptions. Works with SolidStart, Astro, and standalone apps.

Installation

npm install @seriphxyz/solid

Works with SolidJS 1.8+. Compatible with SolidStart, Astro, and standalone apps.

Quick Start

createSubscribe

import { createSubscribe } from "@seriphxyz/solid"

function SubscribeForm() {
  const { submit, status, message } = createSubscribe({
    siteKey: "your-key"
  })

  return (
    <form onSubmit={(e) => { e.preventDefault(); submit(email()) }}>>
      <input type="email" />
      <button disabled={status() === "loading"}>Subscribe</button>
    </form>
  )
}

createReactions

import { createReactions } from "@seriphxyz/solid"

function LikeButton() {
  const { counts, userReactions, add, remove } = createReactions({
    siteKey: "your-key",
    pageId: "my-page"
  })

  const hasLiked = () => userReactions().includes("like")

  return (
    <button onClick={() => hasLiked() ? remove("like") : add("like")}>
      {hasLiked() ? "Unlike" : "Like"} ({counts().like || 0})
    </button>
  )
}

createComments

import { createComments } from "@seriphxyz/solid"

function Comments() {
  const { comments, post, status } = createComments({
    siteKey: "your-key",
    pageId: "my-page"
  })

  return (
    <div>
      <For each={comments()}>
        {(c) => <div>{c.content}</div>}
      </For>
    </div>
  )
}

Available Primitives

createSubscribe
createReactions
createComments
createForm
createWaitlist
createFeedback
createPoll
createAnnouncements
createViewCounts

Full API Reference

For complete documentation including all primitive options, return values, and TypeScript types, see the package README: