Installation/Astro
Install Default File UI in Astro with the React integration.
Design your setup in a live studio, then copy one command tailored to this framework.
Open Create for AstroScaffold a new project with Default File UI already configured.
Creates the framework app and wires Default File UI (package, CSS, and framework config). The kit owns the app stylesheet in a project it scaffolds, so template tokens never shadow kit tokens.
Scaffold with the CLI (npm)
1npx --yes -p @default-file/ui df-ui init -t astro --name my-astro-app
Move into my-astro-app and run the dev server.
Start the app (npm)
1npm run dev
Copy the Button source into your app and import from `@/default-file-ui/components/df-button`. Those files become yours. Later kit releases do not replace them unless you run `df-ui add button --force`. To use the package instead, skip this step and import from `@default-file/ui`.
Add a component (npm)
1npx --yes -p @default-file/ui df-ui add button
Use a component
12345---import { Button } from "@default-file/ui/components/df-button"---<Button client:load>Click me</Button>
Configure with the CLI in your app folder, or follow the manual steps.
Include the React integration. Skip if you already have Astro + React.
Create a project
12npm create astro@latestnpx astro add react
Configure with the CLI (npm)
1npx --yes -p @default-file/ui df-ui init --framework astro
Or install manually (npm)
1npm install @default-file/ui react react-dom lucide-react
Import once in a shared layout (for example `src/layouts/Layout.astro`). Keep this import first in the file. Starter templates often declare their own `--background`, `--foreground`, or `--border` under `:root`. Those names are kit semantic tokens, so remove or rename them to keep kit theming and dark mode intact.
Import the stylesheet
123456789---import "@default-file/ui/css/df-index.css"---<html lang="en"><body><slot /></body></html>
Copy the Button source into your app and import from `@/default-file-ui/components/df-button`. Those files become yours. Later kit releases do not replace them unless you run `df-ui add button --force`. To use the package instead, skip this step and import from `@default-file/ui`.
Add a component (npm)
1npx --yes -p @default-file/ui df-ui add button
Interactive widgets need a client directive so Astro hydrates them.
Use a component as an island
12345---import { Button } from "@default-file/ui/components/df-button"---<Button client:load>Click me</Button>
Using a different stack? Choose another framework.