npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ionic-sveltekit/example

v0.0.11

Published

Example app demonstrating a SvelteKit project with Ionic UI components

Readme

@ionic-sveltekit/example

This repository contains an example Ionic project built with SvelteKit and the @ionic-sveltekit/core integration package. It serves as the template for new projects created with the npx @ionic-sveltekit/create CLI tool, and makes use of framework components and helpers provided by @ionic-sveltekit/components.

Features

The example project demonstrates various aspects of modern Svelte/SvelteKit (5+) development including:

  • 🧩 Svelte Runes - Using $state, $derived, $props(), etc.
  • 🔄 Svelte Snippets & Renders - Modern feature for reusable template fragments with {#snippet} and {@render}
  • 📦 Svelte Stores - State management with readable stores
  • 🧭 SvelteKit Routing - File-based routing pattern
  • 🔄 Server Components - Server-side load functions
  • 🔐 Environment Variables - Using $env/static/private
  • 🎨 Ionic Components - Utilizing Ionic UI components with Svelte
  • 📱 Cross-Platform - Works on iOS, Android, and web

Project Structure

src/
├── lib/
│   ├── components/           # Reusable components
│   │   ├── PlanetCard.svelte # Card component for planets
│   │   ├── Timer.svelte      # Timer component with tooltip
│   │   └── planet-card-content/
│   │       ├── earth.svelte  # Content for Earth
│   │       ├── mars.svelte   # Content for Mars
│   │       └── ...           # Other planet contents
│   ├── stores/               # Svelte stores
│   │   └── timer.ts          # Timer store
│   └── images/               # Image assets
├── routes/                   # SvelteKit routes
│   ├── +layout.svelte        # Root layout with Ionic tabs
│   ├── +page.svelte          # Homepage with interactive elements
│   └── planets/              # Planets route
│       ├── +page.svelte      # List of planets with range slider
│       └── [planet]/         # Dynamic route for individual planets
│           ├── +page.server.ts # Server-side load function (for Mars weather)
│           ├── +page.svelte    # Planet page component
│           └── +page.ts        # Client-side load function
└── theme/                    # Ionic theming

Key Components

PlanetCard.svelte

A reusable card component for displaying planet information, supporting:

  • Planet name and subtitle
  • Optional image
  • Dynamic content via component injection
  • TypeScript type safety with a Planet type

Timer.svelte

A small timer component that displays how long the app has been running, using:

  • Svelte stores for time tracking
  • Ionic tooltip components
  • CSS view transitions

Route Structure

  • Homepage: Interactive demo with SVG animations and clickable buttons
  • Planets List: Adjustable list using Ionic range slider
  • Individual Planet Pages: Dynamic routes with server and client data loading, each showcasing different Ionic UI components:
    • Mercury: Popovers with information tooltips
    • Earth: Reorderable lists
    • Mars: Weather data with custom styling
    • Saturn: List with different colored badges
    • Neptune: Scrollable segments with icons

Technical Highlights

Svelte Runes

The project uses Svelte 5's runes API for reactive state:

// From +page.svelte
let spinCount = $state(0);
let clickCount = $state(0);
const rotate = $derived((spinCount + clickCount) * -22.5);

Snippets & Renders

The project demonstrates Svelte's modern snippet and render features for reusable template fragments:

<!-- From planets/+page.svelte -->
{#snippet planetLink(planet: Planet)}
  <a href="/planets/{planet}">{planet}</a>
{/snippet}

<!-- Later in the file -->
{@render planetLink(planet)}

Dynamic Imports

The project demonstrates dynamic imports for components and assets:

// From planets/[planet]/+page.ts
async function getDynamicImport(planet: Planet, isComponent: boolean = true) {
  let module: { default: Component | string } | undefined;
  try {
    module = await import(isComponent
      ? `$components/planet-card-content/${planet}.svelte`
      : `$images/planets/${planet}.jpg`);
  } catch (e) {
    // Error handling...
  }
  return module?.default;
}

Server-Side Data Fetching

For the Mars planet page, the project fetches real-time weather data from NASA's API:

// From planets/[planet]/+page.server.ts
export const load: PageServerLoad = async ({ params, fetch }) => {
  if (params.planet !== 'mars') {
    return {};
  }

  // Fetch from NASA API...
};

Development

Requirements

  • Node.js 18+
  • A NASA API key (for Mars weather data)

Setup

  1. Clone the repository
  2. Install dependencies: npm install
  3. Create a .env file with your NASA API key:
    NASA_API_KEY=your_api_key_here
  4. Start the development server: npm run dev

Building for Production

npm run build

Using This Project as a Template

This project serves as the base template when creating a new project with:

npx @ionic-sveltekit/create my-app

License

MIT