citec-react-islands

Guides creation and review of hydrated React islands in Astro frontends.

Updated Jun 9, 2026
One-click install
npx skills add https://github.com/TOBIASpuchito/Citec --skill citec-react-islands-tobiaspuchito
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: citec-react-islands
Source: https://github.com/TOBIASpuchito/Citec/tree/main/citec-frontend/.codex/skills/citec-react-islands
Command: npx skills add https://github.com/TOBIASpuchito/Citec --skill citec-react-islands-tobiaspuchito

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires lucide-react.

What problem does it solve? Building interactive React components inside an Astro site often leads to over-hydration, browser API crashes during server rendering, leaked event listeners, and inaccessible controls. This Skill provides a disciplined workflow for creating, editing, and reviewing hydrated React islands in the CITEC frontend so components stay typed, accessible, and correctly hydrated. ## Core Features & Use Cases - Hydration Strategy Guidance: Choose between client:load, client:visible, and lighter Astro directives based on whether interaction is above the fold or deferrable. - Browser-Safe Component Rules: Guard window, document, localStorage, and media queries behind effects or typeof window checks, and clean up listeners, timers, GSAP timelines, ScrollTriggers, and animation frames on unmount. - Accessibility & Icon Standards: Use lucide-react icons with aria-hidden for decorative cases, label icon-only buttons, preserve keyboard access, and keep focus states visible. - Use Case: When adding a mobile filter menu to an Astro page, use this Skill to build a typed, self-contained island with client:visible hydration, proper effect cleanup, and keyboard-accessible controls, then validate with bun run check. ## Quick Start Use the citec-react-islands skill to review my hydrated React component in src/islands for hydration, cleanup, and accessibility issues.

Frequently Asked Questions about citec-react-islands

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

FAQPage Schema
How do I choose between client:load and client:visible in Astro?▼

Use client:load only for above-the-fold or immediately required interaction, and client:visible for deferred interactive sections. Prefer lighter directives whenever possible to reduce hydration cost.

How do I use browser APIs like window in React islands?▼

Access window, document, localStorage, and media queries only inside effects or behind a typeof window !== "undefined" guard. Reading them during server render will break the Astro build.

When should a component go in src/islands versus stay an Astro component?▼

Only components that need client-side execution belong in src/islands. Ordinary presentational components should remain as static .astro components to avoid unnecessary hydration.

Why does my React island leak memory after unmount?▼

Leaks happen when event listeners, timers, observers, GSAP timelines, ScrollTriggers, or requestAnimationFrame loops are not cleaned up. Always return cleanup functions from effects that register these handles.

How do I make lucide-react icons accessible in React components?▼

Mark decorative icons with aria-hidden="true" and provide accessible labels for icon-only buttons. Also preserve keyboard access and visible focus states for all interactive controls.