Skip to content

Quick Start

Get started with Cosmos in just a few minutes.

The fastest way to use Stitch components is via CDN:

<!DOCTYPE html>
<html>
<head>
<script type="module">
import 'https://cdn.getcosmos.dev/stitch.esm.min.js';
</script>
</head>
<body>
<stx-button variant="primary">Hello Cosmos!</stx-button>
<stx-card>
<h2>Welcome</h2>
<p>This is a Stitch card component.</p>
</stx-card>
</body>
</html>

For a build-time installation:

Terminal window
npm install @getcosmos/stitch

Then import the components you need:

// Import everything
import '@getcosmos/stitch/all';
// Or import specific components
import '@getcosmos/stitch/button';
import '@getcosmos/stitch/card';

The Cosmos API is available at https://api.getcosmos.dev.

// Check API status
const response = await fetch('https://api.getcosmos.dev/about');
const data = await response.json();
console.log(data);
// { name: 'Cosmos API', version: '0.0.1', ... }

View the full API documentation at api.getcosmos.dev/docs.