Capri

screenshot of Capri

Build static sites with interactive islands

Overview

Capri is a tool that enables users to build static websites using their preferred frontend framework such as React, Preact, Vue, Solid, or Svelte. One of its key advantages is its carbon-friendly approach, where no JavaScript is shipped to the browser by default. Capri also allows for client-side interactivity by selectively sending only the necessary JavaScript code for specific components, referred to as "islands". Users can leverage their existing knowledge of their chosen framework and follow a couple of rules to build static websites with Capri.

Features

  • Frontend Framework Flexibility: Choose from popular frontend frameworks like React, Preact, Vue, Solid, or Svelte to build static websites with Capri.
  • Carbon-Friendly Approach: No JavaScript is shipped to the browser by default, leading to reduced carbon footprint and improved performance.
  • Selective Client-Side Interactivity: Convert specific components into islands to enable client-side interactivity. Capri ensures that only the relevant JavaScript code is sent to the browser for these interactive parts.
  • No New APIs to Learn: Use your chosen frontend framework's existing ecosystem without the need to learn new APIs. Capri does not have its own API.
  • No Lock-In: If you decide to remove Capri from your project, you will still have a fully functional Vite app. The output will be changed from pre-rendered static pages to a regular Single Page Application (SPA).
  • Live CMS Previews: When connected to a headless CMS, Capri allows for generating a separate SPA version of your site. This enables real-time content previews within the CMS without the need for a build-step or server-side rendering. Users can host the static files inexpensively and efficiently while still having live previews.
eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.