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 🙏

© 2024 – Pkg Stats / Ryan Hefner

super-navigation

v0.0.55

Published

## Not Your Average Navigation

Downloads

1,156

Readme

SuperNavigation

Not Your Average Navigation

SuperNavigation is a powerful, customizable navigation library for Svelte and SvelteKit applications. It aims to bring a mobile UX to the web, making PWAs one step closer to a true native experience.

Caution

Not ready for production, Documentation is under progress

Features

  • Easy-to-use API for navigation between screens
  • Customizable header and screen styles
  • Dynamic screen loading
  • Built with TypeScript for type safety
  • Supports deep routing and nesting
  • Refreshable navigation states
  • Optimized for SvelteKit with server-side rendering support
  • Tailwind out of the box

Installation

To install SuperNavigation, run the following command:

npm install super-navigation

Or if you're using Yarn:

yarn add super-navigation

Usage

Stack navigation example

You can find a full working example at https://github.com/0xDjole/super-navigation/tree/master/src/routes. Pull https://github.com/0xDjole/super-navigation and run npm run dev to play with the very basic example.

<script lang="ts">
  import { navigation } from 'super-navigation';
</script>

<Stack
  defaultIndex={0}
  screens={[
    {
      component: FakeScreen,
      title: 'Screen 1',
      headerClass: 'bg-gray-500 border-solid border-b-2 border-gray-300',
      path: '/'
		},
    {
      component: FakeScreen2,
      title: 'Screen 2',
      path: '/screen2',
      headerClass: 'bg-gray-500 border-solid border-b-2 border-gray-300',
      backDefault: '/'
    }
  ]}
/>

FakeScreen component

<script lang="ts">
  import { onMount } from 'svelte';
  import { navigation } from 'super-navigation';

  onMount(() => {
    navigation?.loadUp();
  });
</script>

<div style="height: 100%; background-color: red;">
  <span class="text-white">Screen 1</span>
  <div>
    <button class="bg-green-300 p-3" on:click={() => navigation?.navigate('/screen2')}>
      Go to screen 2
    </button>
  </div>
</div>

navigation.navigate('/path')

This is how you are navigating to different screens.

navigation.getSearchParam('param')

Get the current query parameters

navigation.back();

Go to the previous screen

navigation.loadUp();

SuperNavigation is optimized for SvelteKit, allowing for server-side rendering of the initial screen with regular +page.svelte from the routes. You then switch to client-side navigation navigation.loadUp() and perform regular navigation with navigation.navigate('/path').

License

This project is licensed under the MIT License - see the LICENSE.md file for details.