leptos-data-loading

Load and stream asynchronous data in Leptos with Resource and Suspense.

Updated May 26, 2026
One-click install
npx skills add https://github.com/adelabdelgawad/rust-fullstack-agents --skill leptos-data-loading
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: leptos-data-loading
Source: https://github.com/adelabdelgawad/rust-fullstack-agents/tree/main/plugins/rusty/skills/leptos-data-loading
Command: npx skills add https://github.com/adelabdelgawad/rust-fullstack-agents --skill leptos-data-loading

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Leptos data loading often requires careful orchestration of Resource and LocalResource APIs, Suspense, and Transition to ensure SSR streams correctly, avoids double-fetches, and keeps the UI responsive.

Core Features & Use Cases

  • Resource::new for standard SSR-streamed data loading and automatic reactivity.
  • Resource::new_blocking for SEO-critical head data and metadata.
  • Transition for refetchable or tabbed content to preserve old data during reloads.
  • LocalResource::new for browser-only sources like geolocation, IndexedDB, or Web APIs.
  • SSR mode configuration to balance TTFB and SEO requirements across OutOfOrder, InOrder, Async, and PartiallyBlocked.

Quick Start

Create a Leptos component that uses Resource::new to fetch data and wrap it in Suspense for correct SSR streaming.

Frequently Asked Questions about leptos-data-loading

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

FAQPage Schema
How do I load and stream asynchronous data in Leptos with SSR?▼

Load asynchronous data in Leptos using Resource::new and wrap components in Suspense to enable correct SSR streaming. This combination fetches server data reactively while ensuring the UI streams seamlessly to the client without blocking initial render.

When should I use LocalResource instead of Resource in Leptos?▼

Use LocalResource::new in Leptos when fetching browser-only data sources like geolocation, IndexedDB, or Web APIs. It prevents server-side execution attempts, ensuring the data fetching only occurs on the client side during browser execution.

How do I prevent UI flickering when refetching data in Leptos?▼

Prevent UI flickering during Leptos data refetching by wrapping your components in Transition. Transition preserves the old data on screen while the new data loads, ensuring a seamless UX for refetchable or tabbed content.

How do I configure Leptos SSR streaming modes for SEO and TTFB?▼

Configure Leptos SSR streaming modes by selecting OutOfOrder, InOrder, Async, or PartiallyBlocked variations. Use Resource::new_blocking for SEO-critical head data and metadata to balance Time To First Byte with rendering requirements.

Why should I avoid reading Leptos resources inside effects?▼

Reading Leptos resources inside effects breaks reactivity and can cause data fetching issues. Enforce correct read patterns by accessing resources directly within the component body or Suspense context to maintain proper SSR streaming.