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

@stellix-agency/silt

v1.2.7

Published

A declarative, capability-driven component framework for SolidJS.

Readme

Silt

A declarative, capability-driven component framework for SolidJS.


Installation

bun add @stellix.agency/silt

Peer dependencies: solid-js, zod


Core concepts

Silt structures UI components around three primitives:

| Primitive | Purpose | |---|---| | defineComponent | Declares state, wires slots, wraps capabilities | | defineSlot | Defines a structural section of a component | | Capabilities | Pluggable custom behaviors (validation, async actions) |


Quick start

// button/slots/label/index.tsx
import type { ButtonState } from "../../types";
import { defineSlot } from "@stellix.agency/silt";
import { labelStyles } from "./styles";

export default defineSlot<ButtonState>((content, state) =>
  content ? <span class={labelStyles({ size: state.size })}>{content}</span> : null
);
// button/index.tsx
import { defineComponent, useComponent } from "@stellix.agency/silt";
import { buttonStyles } from "./button.styles";
import * as slots from "./slots";

const initialState: ButtonState = { loading: false, disabled: false, size: "md", variant: "primary" };

export const Button = defineComponent({
  name: "Button",
  state: initialState,
  slots,
  render: ({ Icon, Label, Spinner }) => {
    const { state, class: className } = useComponent<ButtonState>()
    return (
      <button
        disabled={state.disabled || state.loading}
        class={buttonStyles({ size: state.size, variant: state.variant, class: className })}
      >
        <Spinner />
        <Icon />
        <Label />
      </button>
    )
  },
});
// Consumer usage
<Button size="lg" variant="primary">
  <Button.Label>Send</Button.Label>
</Button>

// With class override and controlled loading
<Button class="w-full" loading={isSaving()}>
  <Button.Label>Save</Button.Label>
</Button>

API

defineComponent(options)

Creates a composable, stateful component.

defineComponent({
  name: string,
  state: TState,
  slots?: Record<string, SlotComponent>,
  capabilities?: CapabilityEntry[],
  render: (slots: { [K in keyof TSlots]: Component }) => JSXElement,
})

slots : Object mapping slot names to slot components (created via defineSlot). The framework wires each slot automatically: in render, slot names arrive as ready-to-render <SlotName /> components.

Controlled props : All state keys, plus class, are accepted as props from outside:

<Button loading={true} class="w-full" />

Sub-components : One sub-component is attached per slot key, for consumer usage:

<Button>
  <Button.Icon><ArrowRight /></Button.Icon>
  <Button.Label>Send</Button.Label>
</Button>

defineSlot<TState>(render)

Defines a structural slot component.

defineSlot<TState>(
  render: (content: JSXElement | undefined, state: TState) => JSXElement | null
): Component<{ content?: ParentComponent }>

The render callback receives:

  • content : Consumer-provided JSX (undefined if slot was not used).
  • state : Parent component's reactive state, for CVA variant resolution.

For write access to state or capability hooks, call them directly inside the callback:

// Wrapper slot : Only renders if consumer used it
export default defineSlot((content) =>
  content ? <div class={headerStyles()}>{content}</div> : null
)

// State-aware slot : Resolves CVA variants
export default defineSlot<ButtonState>((content, state) =>
  content ? <span class={labelStyles({ size: state.size })}>{content}</span> : null
)

// Internal slot : Uses context hooks, ignores consumer content
export default defineSlot<FormState>((_, state) => {
  const { set } = useComponent<FormState>()
  const { errors } = useValidation()
  return (
    <input
      value={state.email}
      onInput={(e) => set("email", e.currentTarget.value)}
      class={inputStyles({ invalid: !!errors()["email"] })}
    />
  )
})

useComponent<TState>()

Reads state and exposes set from within any render function or slot. Throws if called outside a defineComponent tree.

const { state, set, class: className } = useComponent<ButtonState>()

set("loading", true)

useValidation()

Available when ValidationProvider is mounted as a capability.

const { errors, validate } = useValidation()

validate("login")  // Runs schema keyed "login" against state
errors()["email"]  // Reactive error string or undefined

useActions()

Available when ActionsProvider is mounted as a capability.

const { loading, error, run } = useActions()

run("submit")    // Executes action keyed "submit"
loading()        // True while running
error()          // Last error message, undefined when none

Capabilities

Capabilities wrap a component's render tree in context providers. Mount them via the capabilities array in defineComponent.

Validation

import { ValidationProvider } from "@stellix.agency/silt";
import { z } from "zod";

const schemas = {
  login: z.object({
    email: z.string().email("Invalid email"),
    password: z.string().min(8, "Min 8 characters"),
  }),
};

capabilities: [
  { Provider: ValidationProvider, props: { schemas } },
];

Action errors are passed through automatically, throw from an action and the message appears in error().

Actions

import { ActionsProvider } from "@stellix.agency/silt"
import type { ActionRecord } from "@stellix.agency/silt"

const actions: ActionRecord = {
  submit: async (state) => {
    await api.post("/login", { email: state["email"], password: state["password"] })
  },
}

capabilities: [
  { Provider: ActionsProvider, props: { actions } },
]

File structure convention

my-component/
  types.ts               ← ComponentState interface
  my-component.styles.ts ← Root CVA styles
  actions/
    submit.action.ts     ← One action per file
    index.ts             ← ActionRecord barrel
  slots/
    header/
      index.tsx          ← defineSlot
      styles.ts          ← CVA styles for this slot
    fields/
      index.tsx
      styles.ts
    footer/
      index.tsx
      styles.ts
    index.ts             ← export { default as Header } from "./header" ...
  index.tsx              ← defineComponent

import * as slots from "./slots" then slots passes directly to defineComponent.


Styling convention

All styles live in *.styles.ts according to CVA

// button.styles.ts
import { cva } from "class-variance-authority";

export const buttonStyles = cva("inline-flex items-center ...", {
  variants: {
    size: { sm: "px-3 py-1.5 text-xs", md: "px-4 py-2 text-sm", lg: "px-5 py-2.5 text-base" },
    variant: { primary: "bg-blue-600 text-white", secondary: "bg-gray-100 text-gray-900" },
  },

  defaultVariants: { size: "md", variant: "primary" },
});

State flows from defineSlot's second argument into CVA variant calls:

export default defineSlot<ButtonState>((content, state) =>
  content ? <span class={labelStyles({ size: state.size })}>{content}</span> : null
)