Astro 5 + React-island showcase for react-floaty — live demos of the floating action toolbar across mobile and desktop contexts.
- Astro 5 — static-first, partial hydration
- React 18 — only inside three islands (
HeroDemo,Examples,Customization) react-floaty— the library being showcased- Vercel — deploy target via
@astrojs/vercel
Most of the page is pre-rendered HTML; React ships only for interactive surfaces.
- Hero — interactive bar with auto-summon and Live/Source tabs
- Examples — seven live use cases (Demo + Code per card)
- Customization — nine themes, including radial / animated / dock layouts
- API — Provider props + hook surface
npm install
npm run dev # http://127.0.0.1:4321/The site pulls react-floaty directly from GitHub via github:reynsu/floaty#main.
The lib's dist/ is gitignored, but a prepare script in its package.json
rebuilds it automatically on every npm install — including the one Vercel
runs during deploy. Once the package is published to npm, switch to:
- "react-floaty": "github:reynsu/floaty#main",
+ "react-floaty": "^0.1.0",npm run build # static output to dist/ + .vercel/output/static
npm run preview # serves dist/ locallyastro check runs as part of npm run build — type errors fail the build.
Two ways:
- Sign in at vercel.com and pick Add New… → Project.
- Import
reynsu/floaty-site. - Vercel auto-detects Astro and uses
npm run build. No further config needed. - (Optional) Set env var
SITE_URLto your custom domain (e.g.https://floaty.dev) so canonical URLs, the sitemap, and OG meta point at the right place. - Deploy. Subsequent pushes to
maintrigger preview / production builds automatically.
npm i -g vercel
vercel login
vercel # creates a preview deploy
vercel --prod # promotes to production@astrojs/verceladapter inastro.config.mjs(output: 'static')vercel.json— security headers (HSTS, frame-options, referrer-policy, permissions-policy), immutable cache for_astro/*+ favicons + manifest, short cache for sitemap/robots- Web Analytics enabled via the adapter (
webAnalytics: { enabled: true }) - Build artifacts:
dist/(Astro) +.vercel/output/(Vercel build output API). Both gitignored.
| Name | Required | Default | Purpose |
|---|---|---|---|
SITE_URL |
no | https://floaty.dev |
Canonical URL, OG og:url, sitemap entries |
MIT