Install
$ agentstack add skill-impertio-studio-solidjs-claude-skill-package-solid-syntax-components ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
solid-syntax-components
Quick Reference
Component Types
| Type | Children | Use When | |------|----------|----------| | Component | Optional (untyped) | General-purpose component | | ParentComponent | Required (children: JSX.Element) | Layout wrappers, containers | | VoidComponent | Forbidden | Icons, inputs, leaf nodes | | FlowComponent | Typed (children: C) | Control flow, render props |
Props Handling
| Need | Tool | Import | |------|------|--------| | Access prop values | props.x directly | -- | | Derived values outside JSX | () => props.x | -- | | Separate prop groups | splitProps(props, [...keys]) | solid-js | | Default prop values | mergeProps(defaults, props) | solid-js | | Spread remaining props | splitProps + {...rest} | solid-js |
Children Resolution
| Need | Tool | Import | |------|------|--------| | Resolve and cache children | children(() => props.children) | solid-js | | Iterate resolved children | resolved.toArray() | solid-js |
Ref Patterns
| Pattern | Syntax | When | |---------|--------|------| | Variable assignment | let ref!: HTMLElement | Standard ref | | Callback | ref={(el) => { ... }} | Side effects on creation | | Signal ref | const [ref, setRef] = createSignal() | Conditional elements | | Forwarding | Pass ref as regular prop | Parent needs child DOM access |
Event Systems
| System | Syntax | Listener Location | Use When | |--------|--------|-------------------|----------| | Delegated | onClick={handler} | document (shared) | Common UI events (23 events) | | Native | on:scroll={handler} | Element (direct) | Custom events, stopPropagation needed |
Critical Warnings
NEVER destructure props in function parameters or body -- this severs reactivity. Props are reactive getters on a proxy object. ALWAYS access as props.x.
NEVER access props.children multiple times without the children() helper -- each access can re-create child elements. ALWAYS resolve with children(() => props.children).
NEVER use useRef or forwardRef -- these are React APIs. ALWAYS use let ref!: HTMLElement for refs and pass ref as a regular prop for forwarding.
NEVER use event.stopPropagation() with delegated events expecting it to prevent other delegated handlers -- delegated events share a single document listener. ALWAYS use on: prefix when propagation control is needed.
NEVER call a handler signal directly in an event attribute (onClick={handler()}) -- this evaluates once. ALWAYS wrap in an arrow function: onClick={() => handler()}.
Component Type Decision Tree
Creating a new component?
|
+-- Does it accept children?
| |
| +-- YES: Are children a specific type (render prop, typed slot)?
| | |
| | +-- YES --> FlowComponent
| | +-- NO --> ParentComponent
| |
| +-- NO: Will it NEVER have children?
| |
| +-- YES --> VoidComponent
| +-- MAYBE --> Component
ALWAYS import types from solid-js:
import type { Component, ParentComponent, VoidComponent, FlowComponent } from "solid-js";
Props Handling
WRONG vs CORRECT: Destructuring
// WRONG -- breaks reactivity (frozen at initial value):
function Greeting({ name }: { name: string }) {
return Hello {name};
}
// WRONG -- same problem:
function Greeting(props: { name: string }) {
const { name } = props;
return Hello {name};
}
// CORRECT -- reactive access:
const Greeting: Component = (props) => {
return Hello {props.name};
};
// CORRECT -- derived accessor for use outside JSX:
const Greeting: Component = (props) => {
const upper = () => props.name.toUpperCase();
return Hello {upper()};
};
splitProps -- Reactive Prop Separation
import { splitProps } from "solid-js";
const Button: ParentComponent = (props) => {
const [local, styleProps, rest] = splitProps(
props,
["onClick", "disabled"], // Group 1: behavior
["variant", "class"] // Group 2: styling
); // rest: everything else
return (
{props.children}
);
};
mergeProps -- Default Values
import { mergeProps } from "solid-js";
const Button: ParentComponent = (props) => {
const merged = mergeProps(
{ variant: "primary", size: "md", disabled: false },
props
);
// Later sources override earlier ones -- props overrides defaults
return {props.children};
};
Children
WRONG vs CORRECT
// WRONG -- accessing props.children multiple times re-creates elements:
const Bad: ParentComponent = (props) => {
createEffect(() => { console.log(props.children); }); // Re-creates!
return {props.children}; // Creates again!
};
// CORRECT -- resolve once with children() helper:
import { children } from "solid-js";
const Good: ParentComponent = (props) => {
const resolved = children(() => props.children);
createEffect(() => { console.log(resolved()); }); // Stable reference
return {resolved()};
};
Iterating Children
const List: ParentComponent = (props) => {
const resolved = children(() => props.children);
return (
{(child) => {child}}
);
};
Refs
WRONG vs CORRECT: React useRef vs SolidJS ref
// WRONG (React pattern):
const ref = useRef(null);
useEffect(() => { ref.current?.getContext("2d"); }, []);
return ;
// CORRECT (SolidJS):
let canvasRef!: HTMLCanvasElement;
onMount(() => { canvasRef.getContext("2d"); });
return ;
React vs SolidJS Ref Comparison
| Aspect | React useRef | SolidJS ref | |--------|---------------|---------------| | Declaration | const ref = useRef(null) | let ref!: HTMLElement | | Access | ref.current | ref (direct) | | Timing | After mount (useEffect) | Assigned during render, use in onMount | | Hook required | Yes (useRef) | No -- plain variable | | Forwarding | forwardRef() HOC | Pass ref as regular prop | | Directives | No built-in system | use: prefix for reusable behaviors |
Ref Forwarding
// Parent:
function Parent() {
let childRef!: HTMLCanvasElement;
onMount(() => { childRef.getContext("2d"); });
return ;
}
// Child -- ref is ALWAYS received as a callback, regardless of parent declaration:
const ChildCanvas: Component void) }> = (props) => {
return ;
};
Directives (use:)
Directive Signature
function directiveName(element: Element, accessor: () => any): void;
Example: clickOutside
import { onCleanup } from "solid-js";
function clickOutside(element: Element, accessor: () => () => void): void {
const onClick = (e: Event) => {
if (!element.contains(e.target as Node)) accessor()();
};
document.addEventListener("click", onClick);
onCleanup(() => document.removeEventListener("click", onClick));
}
// TypeScript declaration (required to avoid errors):
declare module "solid-js" {
namespace JSX {
interface Directives {
clickOutside: () => void;
}
}
}
// Usage:
setOpen(false)}>Dropdown content
Event Handling
Delegated Events (23 Events)
beforeinput, click, dblclick, contextmenu, focusin, focusout, input, keydown, keyup, mousedown, mousemove, mouseout, mouseover, mouseup, pointerdown, pointermove, pointerout, pointerover, pointerup, touchend, touchmove, touchstart
For ALL other events, ALWAYS use the on: prefix.
Array Binding Syntax
const handler = (data: string, event: MouseEvent) => {
console.log("Data:", data, "Target:", event.target);
};
// Avoids creating a new closure -- data is first arg, event is second:
Click
Event Delegation Caveats
- stopPropagation: Delegated events share a document listener --
stopPropagation()does NOT prevent other delegated handlers. Useon:clickwhen propagation control is needed. - Portals: Events propagate through the component tree, not the DOM tree.
Reference Links
- [references/methods.md](references/methods.md) -- Component types, splitProps, mergeProps, children(), ref patterns, directives, event types
- [references/examples.md](references/examples.md) -- Complete component patterns, props handling, children resolution, ref forwarding, directives, events
- [references/anti-patterns.md](references/anti-patterns.md) -- Destructuring props, useRef, forwardRef, React children patterns, event handler mistakes
Official Sources
- https://docs.solidjs.com/concepts/components/basics
- https://docs.solidjs.com/concepts/components/props
- https://docs.solidjs.com/reference/component-apis/children
- https://docs.solidjs.com/concepts/refs
- https://docs.solidjs.com/concepts/components/event-handlers
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: Impertio-Studio
- Source: Impertio-Studio/SolidJS-Claude-Skill-Package
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.