Back to Skills

reactive-ui-patterns

spences10
Updated 2 days ago
35 views
5
5
View on GitHub
Designreactdesign

About

This skill provides reactive UI patterns for smooth in-place updates when working with remote functions. It enables managing loading states and preventing page jumps through the `.current` property on stored queries. Use it to maintain scroll position and create seamless user experiences during data refreshes.

Quick Install

Claude Code

Recommended
Plugin CommandRecommended
/plugin add https://github.com/spences10/devhub-crm
Git CloneAlternative
git clone https://github.com/spences10/devhub-crm.git ~/.claude/skills/reactive-ui-patterns

Copy and paste this command in Claude Code to install this skill

Documentation

Reactive UI Patterns

Quick Start

<script lang="ts">
	const data_query = get_data(); // Store in variable for .current access

	async function save(id: string, value: string) {
		await update_data({ id, value });
		await data_query.refresh(); // Updates in place!
	}
</script>

{#if data_query.error}
	<p>Error loading data</p>
{:else if data_query.loading && data_query.current === undefined}
	<p>Loading...</p>
{:else}
	{@const items = data_query.current ?? []}
	<div class:opacity-60={data_query.loading}>
		{#each items as item}<!-- Content updates smoothly -->{/each}
	</div>
{/if}

Core Principles

  • Store queries: const query = get_data() enables .current property access
  • Use .current: Prevents page jumps, keeps scroll position during updates
  • Initial load only: Show spinner when .current === undefined, not on every refresh
  • Avoid {#await}: Causes jarring page reloads - use stored query pattern instead

Reference Files

GitHub Repository

spences10/devhub-crm
Path: .claude/skills/reactive-ui-patterns

Related Skills

content-collections

Meta

This skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.

View skill

creating-opencode-plugins

Meta

This skill provides the structure and API specifications for creating OpenCode plugins that hook into 25+ event types like commands, files, and LSP operations. It offers implementation patterns for JavaScript/TypeScript modules that intercept and extend the AI assistant's lifecycle. Use it when you need to build event-driven plugins for monitoring, custom handling, or extending OpenCode's capabilities.

View skill

langchain

Meta

LangChain is a framework for building LLM applications using agents, chains, and RAG pipelines. It supports multiple LLM providers, offers 500+ integrations, and includes features like tool calling and memory management. Use it for rapid prototyping and deploying production systems like chatbots, autonomous agents, and question-answering services.

View skill

cloudflare-turnstile

Meta

This skill provides comprehensive guidance for implementing Cloudflare Turnstile as a CAPTCHA-alternative bot protection system. It covers integration for forms, login pages, API endpoints, and frameworks like React/Next.js/Hono, while handling invisible challenges that maintain user experience. Use it when migrating from reCAPTCHA, debugging error codes, or implementing token validation and E2E tests.

View skill