npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

comark-solid

v0.1.0

Published

Solid renderer for Comark.

Downloads

366

Readme

comark-solid

Solid renderer for Comark.

Installation

npm install comark-solid comark

<Markdown>

Parses Markdown strings and renders them directly.

String input is parsed asynchronously. Wrap the component in Solid's Suspense to show a fallback while parsing.

import { Markdown } from "comark-solid";
import { Suspense } from "solid-js";

const markdown = "# Hello World";

export default function App() {
  return (
    <Suspense fallback={<div>Loading...</div>}>
      <Markdown value={markdown} />
    </Suspense>
  );
}

Props

| Prop | Type | Default | Description | | :----------- | :------------------------------- | :----------- | :--------------------------------------------------------------------------------- | | value | string \| MarkdownDocument | (Required) | Markdown string or pre-parsed document. | | options | ParserOptions | undefined | Options passed to parseMarkdown (ignored if value is a MarkdownDocument). | | components | Record<string, ValidComponent> | {} | Map of AST node names to Solid components. | | data | Record<string, unknown> | {} | Runtime values referenced from markdown via :prop="data.path". | | class | string | undefined | Additional class name for the wrapper div (comark-content is always included). |

<MarkdownDocument>

Renders a pre-parsed MarkdownDocument AST without invoking the parser. Ideal for server-side rendering (SSR), static site generation, or pre-compiled content.

import { parseMarkdown } from "comark";
import { MarkdownDocument } from "comark-solid";

const document = await parseMarkdown("# Hello World");

export default function App() {
  return <MarkdownDocument value={document} />;
}

Props

| Prop | Type | Default | Description | | :----------- | :------------------------------- | :----------- | :--------------------------------------------------------------------------------- | | value | MarkdownDocument | (Required) | Pre-parsed Comark document AST. | | components | Record<string, ValidComponent> | {} | Map of AST node names to Solid components. | | data | Record<string, unknown> | {} | Runtime values referenced from markdown via :prop="data.path". | | class | string | undefined | Additional class name for the wrapper div (comark-content is always included). |

Custom Components

Map tag to Solid components via the components prop:

import { Markdown } from "comark-solid";
import { Card } from "./Card";
import { CustomHeading } from "./CustomHeading";

const components = {
  h1: CustomHeading,
  card: Card,
};

export default function App() {
  return <Markdown value={markdown} components={components} />;
}

Components can also be loaded asynchronously using Solid's lazy():

import { lazy } from "solid-js";

const components = {
  chart: lazy(() => import("./Chart")),
};

Component bindings

Props

Attributes in Comark syntax are passed as props to your component. Use the : prefix to pass typed values:

| Markdown | Prop value | | :-------------------------- | :------------------------ | | {type="warning"} | "warning" (string) | | {:count="5"} | 5 (number) | | {:active=true} | true (boolean) | | {:config='{"key":"val"}'} | { key: "val" } (object) |

Slots

The default slot is passed as children. Named slots (e.g. #header) are passed as camelCase props prefixed with slot (slotHeader).

::card
#header
Header content

#default
Body content
::
interface CardProps {
  slotHeader?: JSX.Element;
  children?: JSX.Element;
}

export default function Card(props: CardProps) {
  return (
    <div>
      <Show when={props.slotHeader}>{(header) => <div>{header}</div>}</Show>
      <div>{props.children}</div>
    </div>
  );
}

Acknowledgements

This project is heavily based on the official Comark React renderer, adapted for Solid's component model and APIs.

The original implementation is licensed under the MIT License.

License

MIT