├── .gitignore ├── .npmrc ├── .stackblitzrc ├── README.md ├── astro.config.mjs ├── package-lock.json ├── package.json ├── public ├── assets │ └── logo.svg └── favicon.ico ├── sandbox.config.json ├── src ├── components │ ├── ReactCounter.jsx │ ├── SvelteCounter.svelte │ ├── Tour.astro │ └── VueCounter.vue ├── pages │ └── index.astro └── styles │ ├── global.css │ └── home.css └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | # build output 2 | dist 3 | 4 | # dependencies 5 | node_modules/ 6 | 7 | # logs 8 | npm-debug.log* 9 | yarn-debug.log* 10 | yarn-error.log* 11 | 12 | # environment variables 13 | .env 14 | .env.production 15 | 16 | # macOS-specific files 17 | .DS_Store 18 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | # Expose Astro dependencies for `pnpm` users 2 | shamefully-hoist=true 3 | -------------------------------------------------------------------------------- /.stackblitzrc: -------------------------------------------------------------------------------- 1 | { 2 | "startCommand": "npm start", 3 | "env": { 4 | "ENABLE_CJS_IMPORTS": true 5 | } 6 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AstroAgnosticUIStarter 2 | 3 | Experiment leveraging the [Astro](https://astro.build/) starter + [AgnosticUI](https://agnosticui.com/). Renders React, Vue 3, and Svelte components. 4 | 5 | ![image](https://user-images.githubusercontent.com/142403/160301080-1a7be334-3064-4045-9a0a-7a349eba399b.png) 6 | 7 | ## 🧞 Commands 8 | 9 | All commands are run from the root of the project, from a terminal: 10 | 11 | | Command | Action | 12 | |:---------------- |:-------------------------------------------- | 13 | | `npm install` | Installs dependencies | 14 | | `npm run dev` | Starts local dev server at `localhost:3000` | 15 | | `npm run build` | Build your production site to `./dist/` | 16 | | `npm run preview` | Preview your build locally, before deploying | 17 | 18 | ## 👀 Want to learn more? 19 | 20 | Feel free to check [our documentation](https://github.com/withastro/astro) or jump into our [Discord server](https://astro.build/chat). 21 | -------------------------------------------------------------------------------- /astro.config.mjs: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'astro/config'; 2 | import vue from '@astrojs/vue'; 3 | import svelte from '@astrojs/svelte'; 4 | import react from '@astrojs/react'; 5 | 6 | export default defineConfig({ 7 | integrations: [vue(), react(), svelte()], 8 | server: { 9 | port: 3012, 10 | } 11 | }); 12 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@example/starter", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "dev": "astro dev", 7 | "start": "astro dev", 8 | "build": "astro build", 9 | "preview": "astro preview" 10 | }, 11 | "devDependencies": { 12 | "@astrojs/react": "^0.1.0", 13 | "@astrojs/svelte": "^0.0.2", 14 | "@astrojs/vue": "^0.0.2", 15 | "astro": "^1.0.0-beta.0" 16 | }, 17 | "dependencies": { 18 | "agnostic-react": "^0.1.23", 19 | "agnostic-svelte": "^1.1.15", 20 | "agnostic-vue": "^1.0.24", 21 | "react": "^17.0.2", 22 | "react-dom": "^17.0.2", 23 | "svelte": "^3.46.6", 24 | "uuid": "^8.3.2", 25 | "vue": "^3.2.31" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /public/assets/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- 1 | https://rawcdn.githack.com/withastro/astro/main/examples/starter/public/favicon.ico -------------------------------------------------------------------------------- /sandbox.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "infiniteLoopProtection": true, 3 | "hardReloadOnChange": false, 4 | "view": "browser", 5 | "template": "node", 6 | "container": { 7 | "port": 3000, 8 | "startScript": "start", 9 | "node": "14" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/components/ReactCounter.jsx: -------------------------------------------------------------------------------- 1 | import { useState } from 'react'; 2 | import "agnostic-react/dist/common.min.css"; 3 | import "agnostic-react/dist/esm/index.css"; 4 | import { Alert, Button } from "agnostic-react"; 5 | 6 | export default function ReactCounter() { 7 | const [count, setCount] = useState(0); 8 | const add = () => setCount((i) => i + 1); 9 | const subtract = () => setCount((i) => i - 1); 10 | 11 | return ( 12 | <> 13 | 🔥AgnosticUI — React 14 |
15 | 16 |
{count}
17 | 18 |
19 | 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /src/components/SvelteCounter.svelte: -------------------------------------------------------------------------------- 1 | 15 | 16 | 🙌AgnosticUI — Svelte 17 |
18 | 19 |
{ count }
20 | 21 |
22 | -------------------------------------------------------------------------------- /src/components/Tour.astro: -------------------------------------------------------------------------------- 1 |
2 |
3 |

👀 Astro + AgnosticUI == 🚀

4 |

AgnosticUI lets you create one theme that works across all your frameworks 🎉 👊

5 |
6 |
7 | 12 | -------------------------------------------------------------------------------- /src/components/VueCounter.vue: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /src/pages/index.astro: -------------------------------------------------------------------------------- 1 | --- 2 | // Style Imports 3 | import '../styles/global.css'; 4 | import '../styles/home.css'; 5 | // Component Imports 6 | import Tour from '../components/Tour.astro'; 7 | // You can import components from any supported Framework here! 8 | import ReactCounter from '../components/ReactCounter.jsx'; 9 | import SvelteCounter from '../components/SvelteCounter.svelte'; 10 | import VueCounter from '../components/VueCounter.vue'; 11 | 12 | // Component Script: 13 | // You can write any JavaScript/TypeScript that you'd like here. 14 | // It will run during the build, but never in the browser. 15 | // All variables are available to use in the HTML template below. 16 | let title = 'My Astro Site'; 17 | 18 | // Full Astro Component Syntax: 19 | // https://docs.astro.build/core-concepts/astro-components/ 20 | --- 21 | 22 | 23 | 24 | 25 | {title} 26 | 27 | 28 | 29 | 37 | 38 | 39 |
40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 |
48 | 49 | 50 | -------------------------------------------------------------------------------- /src/styles/global.css: -------------------------------------------------------------------------------- 1 | * { 2 | box-sizing: border-box; 3 | margin: 0; 4 | } 5 | 6 | :root { 7 | font-size: clamp(0.875rem, 0.4626rem + 1.0309vw + var(--user-font-scale), 1.125rem); 8 | } 9 | 10 | body { 11 | padding: 4rem 2rem; 12 | width: 100%; 13 | min-height: 100vh; 14 | display: grid; 15 | justify-content: center; 16 | background: #f9fafb; 17 | color: #0c2c43;; 18 | } 19 | 20 | @media (prefers-color-scheme: dark) { 21 | body { 22 | background: #0c2c43; 23 | color: #fff; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/styles/home.css: -------------------------------------------------------------------------------- 1 | .counter { 2 | display: grid; 3 | grid-auto-flow: column; 4 | gap: 1em; 5 | font-size: 2rem; 6 | justify-content: center; 7 | padding: 2rem 1rem; 8 | } 9 | 10 | .counter > pre { 11 | text-align: center; 12 | min-width: 3ch; 13 | } 14 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "moduleResolution": "node" 4 | } 5 | } 6 | --------------------------------------------------------------------------------