Frontend Components

Design reusable UI components for Astro server-first architectures with islands.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/SpacePlushy/portfolio --skill frontend-components-spaceplushy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Frontend Components
Source: https://github.com/SpacePlushy/portfolio/tree/main/.claude/skills/frontend-components
Command: npx skills add https://github.com/SpacePlushy/portfolio --skill frontend-components-spaceplushy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Inconsistent, non-reusable, or poorly optimized UI components lead to bloated codebases and slow user experiences. This skill guides AI in designing and building high-quality, reusable frontend components following Astro's server-first architecture, accelerating your development.

Core Features & Use Cases

  • Astro Islands Architecture: Directs AI on building components with strategic client-side hydration and proper composition.
  • Type-Safe Development: Guides AI in defining component props with TypeScript interfaces for robust development.
  • Reusability & Performance: Ensures AI creates reusable UI elements, optimizes performance, and documents component APIs.

Quick Start

Create a new 'Card' component in Astro, ensuring it uses slots for flexible content and defines props with TypeScript.

Frequently Asked Questions about Frontend Components

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

FAQPage Schema
How do I build reusable UI components in Astro with TypeScript?

Reusable UI components in Astro combine TypeScript prop interfaces, slots for flexible content, and server-first rendering. Define props with strict types, use named slots for layout flexibility, and apply client directives (client:load, client:idle, client:visible) only where interactivity is needed to keep components lean and performant.

What is Astro's islands architecture and how does it improve performance?

Islands architecture isolates interactive components while keeping the rest of the page server-rendered static HTML. This reduces JavaScript shipped to the browser, speeds up initial page load, and lets you hydrate only the components that need interactivity, avoiding unnecessary client-side overhead.

Can I use React, Vue, or Svelte components inside Astro?

Yes. Astro supports framework components (.jsx, .tsx, .vue, .svelte) alongside native .astro files. Mix frameworks freely within the same project, compose them with slots and props, and control hydration per component using client directives to optimize performance.

How do I optimize component performance and lazy-load in Astro?

Optimize by using client:idle or client:visible directives to defer hydration until needed, implementing code-splitting for framework components, scoping styles to prevent cascade bloat, and integrating Tailwind for efficient utility-based styling without runtime overhead.

Do I need to document component APIs and prop interfaces?

Yes. Comprehensive documentation of component props, slots, and usage examples is essential for reusability and maintainability. TypeScript interfaces serve as inline documentation and enable IDE autocomplete, while written guides help team members and AI systems understand component intent and constraints.

What's the difference between server-rendered and client-hydrated components in Astro?

Server-rendered components output static HTML with no JavaScript; client-hydrated components add interactivity by shipping and executing JavaScript in the browser. Use server-rendering by default, hydrate selectively with client directives, and reserve full client-side components for stateful, interactive features only.