Skip to content

A basic minimal starter template built for Astro with React, Framer Motion, and Tailwind.

License

Notifications You must be signed in to change notification settings

jonnysmillie/astro-base

Repository files navigation

Astro Base

A minimal, modern starter template for building fast websites with Astro. This template includes everything you need to get started with a beautiful landing page, complete with animations, icons, and content management capabilities.

✨ Features

  • πŸš€ Astro - Lightning-fast static site generation
  • βš›οΈ React - Component-based UI library for interactive components
  • 🎨 Tailwind CSS v4 - Utility-first CSS framework for rapid styling
  • 🎭 Framer Motion - Smooth scroll reveal animations with spring physics
  • 🎯 Astro Icons - Beautiful icon component library with Tabler icon set
  • πŸ“ MDX - Write JSX in your Markdown documents
  • πŸ’… Sass - CSS preprocessor with variables, mixins, and nesting
  • πŸ“– Tailwind Typography - Beautiful typography styles for markdown content

πŸ› οΈ Tech Stack

Core Framework

  • Astro ^5.16.6 - The web framework for content-driven websites

Integrations

  • @astrojs/react ^4.4.2 - React integration for Astro
  • @astrojs/mdx ^4.3.13 - MDX support for writing JSX in Markdown
  • astro-icon ^1.1.5 - Icon component library

Styling

  • tailwindcss ^4.1.18 - Utility-first CSS framework
  • @tailwindcss/vite ^4.1.18 - Tailwind CSS Vite plugin
  • @tailwindcss/typography ^0.5.19 - Typography plugin for beautiful markdown styling
  • sass ^1.97.2 - CSS preprocessor

UI & Animation

  • framer-motion ^12.24.7 - Production-ready motion library for React
  • react ^19.2.3 - UI library
  • react-dom ^19.2.3 - React DOM renderer

Icons

  • @iconify-json/tabler ^1.2.26 - Tabler icon set for astro-icon

πŸ“ Project Structure

/
β”œβ”€β”€ public/
β”‚   └── favicon.svg
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ assets/          # Static assets (images, SVGs)
β”‚   β”œβ”€β”€ components/      # Reusable Astro components
β”‚   β”‚   β”œβ”€β”€ CTA.astro           # Call-to-action section
β”‚   β”‚   β”œβ”€β”€ Features.astro      # Features showcase
β”‚   β”‚   β”œβ”€β”€ Footer.astro        # Site footer
β”‚   β”‚   β”œβ”€β”€ Header.astro        # Site header/navigation
β”‚   β”‚   β”œβ”€β”€ Hero.astro          # Hero section
β”‚   β”‚   β”œβ”€β”€ ScrollReveal.tsx    # Scroll animation component
β”‚   β”‚   └── SassExample.astro   # Sass usage example
β”‚   β”œβ”€β”€ layouts/
β”‚   β”‚   └── Layout.astro        # Base page layout
β”‚   β”œβ”€β”€ pages/          # Routes (file-based routing)
β”‚   β”‚   β”œβ”€β”€ index.astro         # Homepage
β”‚   β”‚   β”œβ”€β”€ about.astro         # About page
β”‚   β”‚   β”œβ”€β”€ contact.astro      # Contact page
β”‚   β”‚   β”œβ”€β”€ features.astro      # Features page
β”‚   β”‚   └── example.mdx         # MDX example page
β”‚   └── styles/
β”‚       β”œβ”€β”€ global.css          # Global styles & Tailwind imports
β”‚       └── example.scss        # Sass example file
β”œβ”€β”€ astro.config.mjs    # Astro configuration
β”œβ”€β”€ tailwind.config.mjs # Tailwind configuration
└── package.json

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • npm, pnpm, or yarn

Installation

  1. Clone the repository

    git clone https://github.com/jonnysmillie/astro-base.git
    cd astro-base
  2. Install dependencies

    npm install
  3. Start the development server

    npm run dev
  4. Open your browser Navigate to http://localhost:4321

πŸ“œ Available Scripts

Command Action
npm install Installs dependencies
npm run dev Starts local dev server at localhost:4321
npm run build Build your production site to ./dist/
npm run preview Preview your build locally
npm run astro Run CLI commands like astro add, astro check

🎨 Styling

Tailwind CSS

This project uses Tailwind CSS v4 for styling. All components use Tailwind utility classes.

Global Styles:

  • Located in src/styles/global.css
  • Imports Tailwind CSS
  • Includes Tailwind Typography plugin for markdown styling

Configuration:

  • tailwind.config.mjs - Tailwind configuration with Typography plugin

Sass

Sass is installed and ready to use. You can use Sass in component <style> blocks:

<style lang="scss">
  $primary-color: #000;

  .my-component {
    color: $primary-color;
  }
</style>

See src/components/SassExample.astro for a complete example.

🎭 Components

ScrollReveal

A React component using Framer Motion for scroll-triggered animations:

import ScrollReveal from "./ScrollReveal.tsx";

<ScrollReveal client:load delay={0.2} scale={true}>
  <div>Your content here</div>
</ScrollReveal>;

Props:

  • delay - Animation delay in seconds (default: 0)
  • direction - Animation direction: "up" | "down" | "left" | "right" (default: "up")
  • distance - Distance to travel in pixels (default: 50)
  • scale - Enable scale animation (default: false)

Icons

Use Tabler icons with astro-icon:

---
import { Icon } from "astro-icon/components";
---

<Icon name="tabler:heart" class="w-6 h-6" />

Browse available icons at Tabler Icons.

πŸ“ MDX Support

Write JSX in your Markdown documents. Create .mdx files in the src/pages directory:

---
import Layout from "../layouts/Layout.astro";
---

<Layout>
  # My MDX Page This is **markdown** with <Component /> support!
</Layout>

See src/pages/example.mdx for a complete example.

🎯 Pages

  • / - Homepage with hero, features, and CTA sections
  • /features - Features showcase page
  • /about - About page
  • /contact - Contact form page
  • /example - MDX example page demonstrating markdown features

πŸ”§ Configuration

Astro Config (astro.config.mjs)

export default defineConfig({
  integrations: [
    react(), // React support
    icon(), // Astro Icons
    mdx(), // MDX support
  ],
  vite: {
    plugins: [tailwindcss()],
  },
});

Tailwind Config (tailwind.config.mjs)

import typography from "@tailwindcss/typography";

export default {
  plugins: [typography],
};

πŸ“¦ Key Dependencies

Core

  • Astro - Web framework
  • React - UI library for interactive components
  • Tailwind CSS - Utility-first CSS framework

Integrations

  • @astrojs/react - React integration
  • @astrojs/mdx - MDX support
  • astro-icon - Icon component library

Styling

  • @tailwindcss/typography - Typography plugin
  • sass - CSS preprocessor

Animation

  • framer-motion - Motion library

Icons

  • @iconify-json/tabler - Tabler icon set

🎨 Design Features

  • Black & White Color Scheme - Minimal, clean design
  • Responsive Layout - Mobile-first approach
  • Smooth Animations - Scroll reveal effects with spring physics
  • Modern Typography - Beautiful text styling with Tailwind Typography
  • Component-Based - Reusable, modular components

πŸ“š Learn More

πŸ“„ License

This project is open source and available under the MIT License.

πŸ™ Credits

Built with:


Ready to build something amazing? Download this template and start creating!

About

A basic minimal starter template built for Astro with React, Framer Motion, and Tailwind.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published