Skip to content
🗂️

Starlight File Explorer

Explore and document files and folders in your Starlight site with an interactive file explorer.
  • Directorypublic
    • favicon.svg
  • Directorysrc
    • Directoryassets
      • logo.svg
      • screenshot.jpg
    • Directorycomponents
      • CustomButton.astro
      • InteractiveWidget.jsx
    • Directorycontent
      • Directorydocs
        • index.mdx
    • content.config.ts
  • astro.config.mjs
  • package.json
  • tsconfig.json
src/components/InteractiveWidget.jsx

UI framework component

React

Astro supports a variety of popular frameworks including React, Preact, Svelte, Vue, SolidJS, and AlpineJS with official integrations. You can also find even more community-maintained framework integrations (e.g. Angular, Qwik, Elm).

A framework component can be made interactive (hydrated) using a client:* directive. These are component attributes that determine when your component’s JavaScript should be sent to the browser. For example, in src/content/docs/index.mdx:

import InteractiveWidget from '../../components/InteractiveWidget.jsx';
{/* This component's JS will begin importing when the page loads */}
<InteractiveWidget client:load />

Reference