solid-refs

Manage DOM element refs and custom directives in SolidJS components.

2|2|Updated May 1, 2026
One-click install
npx skills add https://github.com/adamhjk/mvtt --skill solid-refs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: solid-refs
Source: https://github.com/adamhjk/mvtt/tree/main/.claude/skills/solid-refs
Command: npx skills add https://github.com/adamhjk/mvtt --skill solid-refs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and scripts (resource) components.

What problem does it solve?

Managing DOM element references in SolidJS can be cumbersome, especially when creating reusable behaviors and integrating third-party libraries.

Core Features & Use Cases

  • Direct DOM access: Provides variable and callback forms for referencing elements in SolidJS components.
  • Reusable directives: Enables custom DOM behaviors like focus, size observation, and directives via use:*.
  • Use Case: Easily integrate a resize observer on multiple elements or create shared focus behaviors across components.

Quick Start

Use the solid-refs skill to create a reusable focus directive that focuses a button when a condition becomes true.

Frequently Asked Questions about solid-refs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create reusable directives for DOM interactions in SolidJS?

Reusable directives in SolidJS are created using the `use:*` syntax to attach custom behaviors like focus management or size observation directly to DOM elements. This approach encapsulates logic for clean setup and teardown across components.

What is the best way to manage focus and size observation across multiple SolidJS components?

The best way to manage focus and size observation is by creating shared ref behaviors or custom directives. This allows you to easily attach resize observers or focus management logic to multiple elements without duplicating code.

Can I use both variable and callback refs to access DOM elements in SolidJS?

Yes, you can use both variable and callback forms for referencing DOM elements in SolidJS. This dual support ensures type safety and flexibility when integrating third-party libraries or handling direct DOM access.

How do I forward refs through SolidJS components without losing type safety?

Forwarding refs through SolidJS components is handled by passing variable or callback refs down the component tree. This maintains type safety and ensures clean setup and teardown for DOM interactions.

Why does integrating third-party libraries with SolidJS DOM elements become cumbersome?

Integrating third-party libraries becomes cumbersome because managing direct DOM element references and their lifecycle behaviors manually is error-prone. Using structured ref utilities and custom directives ensures clean setup and teardown.