Quick Start
Quick Start
Section titled “Quick Start”Get started with Cosmos in just a few minutes.
Using Stitch Components
Section titled “Using Stitch Components”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>Installing via npm
Section titled “Installing via npm”For a build-time installation:
npm install @getcosmos/stitchThen import the components you need:
// Import everythingimport '@getcosmos/stitch/all';
// Or import specific componentsimport '@getcosmos/stitch/button';import '@getcosmos/stitch/card';Using the API
Section titled “Using the API”The Cosmos API is available at https://api.getcosmos.dev.
// Check API statusconst 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.
Next Steps
Section titled “Next Steps”- Explore Stitch Components
- Read the API Reference
- Join our GitHub Discussions