reactive-ui-patterns

Remote functions reactive UI patterns. Use for smooth in-place updates, preventing page jumps, and managing loading states with .current property.

⭐6stars🔀0forks📁View on GitHub🕐Updated Jan 1, 2026⬇️1downloads

When & Why to Use This Skill

This Claude skill provides a specialized framework for implementing reactive UI patterns with remote functions. It focuses on optimizing frontend user experience by enabling smooth, in-place data updates and sophisticated loading state management. By leveraging the '.current' property pattern, it helps developers eliminate jarring page jumps and layout shifts, ensuring a seamless and professional interface during asynchronous data fetching.

Use Cases

  • Case 1: Real-time data dashboards that require frequent background refreshes without interrupting the user's scroll position or visual focus.
  • Case 2: Complex CRUD applications where list views must reflect updated or deleted items immediately and smoothly after an API call.
  • Case 3: High-performance web applications looking to replace standard async/await loading blocks with a persistent data query pattern to prevent layout shifts and improve perceived speed.
namereactive-ui-patterns
descriptionRemote functions reactive UI patterns. Use for smooth in-place updates, preventing page jumps, and managing loading states with .current property.

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