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

svelte-simple-nav

v0.0.10

Published

Simple responsive navigation bar, with sliding sidepanel, for Svelte.

Downloads

9

Readme

svelte-simple-nav

Simple responsive navigation bar, with sliding sidepanel, for Svelte.

Features

  • Responsive with single break point for mobile/desktop
  • Comes with pre-packaged layouts and anchoring styles
  • Allows customisation of colours, sizes and other key parameters
  • Uses slots for clean implementation

It is simple in the sense that:

  • It does not handle nested lists / large navigation menus
  • It is partially pre-styled, so that it can be setup easily without many (or any) required properties

Installation

npm install svelte-simple-nav

Quick Start

<script>
    import Nav from "svelte-simple-nav"
</script>

<Nav>
    <a href="/" slot="logo">Logo</a>
    <a href="/">Home</a>
    <a href="/login">Login</a>
    <a href="/register">Register</a>
</Nav>

Options

Here is a list of the parameters that you can use to change the look and feel of the <Nav /> component:

  • background (string): sets the background of the nav bar (takes the same input as css background)

  • color (string): sets the default color of <a></a> tags (which are also exposed to the user if additional styling is required)

  • minHeight (string): sets the min-height of the nav bar, which will otherwise grow to fit whatever you put in it

  • maxWidth (string): sets the width of the content within the nav bar (defaults to 960px)

  • anchor (string): sets where the nav bar is positioned on the page and how it interacts with other elements. The options are:
    • "absolute" - placed at the top of the page
    • "fixed-top" - fixed to the top of the browser window, even on scroll
    • "fixed-bottom" - fixed to the bottom of the browser window, even on scroll
    • "static" - fits into its parent element
  • layout (string): sets how the elements within the navbar are positioned. The options are:
    • "center" - Logo and links are all centered
    • "spaced" - Logo snaps to the left hand side, nav links snap to the right
    • "spaced-reverse" - Logo snaps to the right hand side, nav links snap to the left
    • "left" - Logo and links all snap to the left
    • "right" - Logo and links all snap to the right
  • shadow (bool): sets whether to add shadow to nav bar (set to false, for example, if the nav background is transparent)

  • mobileBreak (string): sets the breakpoint for displaying the desktop or mobile nav bar. If you have lots of links, you might need to make the break point earlier. Conversely, if you only have a couple of links, you might not need a hamburger at all :smile:

  • sidepanelBackground (string): sets the background colour for the sliding sidepanel (in mobile view)

  • sidepanelColor (string): sets the text colour for the sliding sidepanel (in mobile view)

TODO

  • Make sidepanel min-width a directly tuneable parameter
  • Clarify and implement optimal markup for accessibilty
  • Expose desktop media query to allow more external customisation