/astro:astro-reactfrom astro
Guides integrating React components in Astro: client directive selection (load, idle, visible, media, only), MDX support, and cross-island state sharing with nanostores.
Ships in astro. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Patterns for using React components in Astro projects (Islands Architecture).
npx astro add react
src/
├── components/
│ ├── Button.astro # Static Astro component
│ ├── Counter.tsx # Interactive React component
│ ├── Chart.tsx # Client-side only component
│ └── SearchBar.tsx # Hydrated on visibility
| Directive | When Hydrates | Use Case |
|---|---|---|
client:load | Page load | Critical interactive UI |
client:idle | Browser idle | Non-critical UI |
client:visible | In viewport | Below-fold, heavy components |
client:media="..." | Media match | Responsive interactions |
client:only="react" | Never SSR | Browser-only APIs |
<Counter client:load initialCount={5} label="Visits" />
<Chart client:visible data={chartData} />
<MobileMenu client:media="(max-width: 768px)" />
<MapComponent client:only="react" coordinates={coords} />
When building React components, passing complex props, or using children/slots, read
references/react-integration-examples.mdfor complete component patterns.
When sharing state between islands with nanostores, read
references/react-integration-examples.mdfor the store setup and useStore pattern.
When using React components in MDX, read
references/react-integration-examples.mdfor MDX integration examples.
client:visible for most componentsclient:load sparingly (increases initial JS)client:only for components with browser-only dependenciesWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
astro-react, client-directives, islands-architecture, nanostores, mdx
11 skills in this plugin
/astro-basicsACTIVATE when creating Astro components, layouts, pages, or setting up Astro project structure. ACTIVATE for 'Astro component', 'slot', 'layout', 'Astro.props', 'class:list'. Covers: component anatomy (frontmatter/template/style/script), layout pattern with slot, props patterns, scoped vs global styles, script patterns (build-time vs client-side), path aliases. DO NOT use for: content collections (see astro-content-collections), routing (see astro-routing), React islands (see astro-react)./astro-content-collectionsACTIVATE when working with Astro content collections, markdown/MDX files, YAML frontmatter, Zod schemas for content, or content-driven pages. ACTIVATE for 'getCollection', 'getEntry', 'defineCollection', 'content collection', 'content.config.ts'. Covers: collection schema definition with Zod, loader-based collections, querying/filtering collections, dynamic routes with getStaticPaths, YAML meta files, MDX with components, collection references. DO NOT use for: routing logic (see astro-routing), general Astro components (see astro-basics)./astro-envACTIVATE when working with environment variables, feature flags, or runtime configuration in Astro. ACTIVATE for 'import.meta.env', '.env', 'PUBLIC_', 'feature flag'. Covers: server vs client variables (PUBLIC_ prefix), feature flags pattern with centralized config, TypeScript env declarations, build-time vs runtime variables, Netlify/Vercel deployment vars. DO NOT use for: general Astro setup, content configuration.npx claudepluginhub fabiensalles/claude-marketplace --plugin astroOther plugins' skills for the same job