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

@isoftdata/svelte-sidebar

v2.0.18

Published

<img src="screenshot.png" alt="alt text" height="500px;">

Downloads

136

Readme

Svelte Sidebar

Install

pnpm i @isoftdata/svelte-sidebar

Breaking changes

2.0.0

  • Require Svelte 5
  • Slots -> Snippets
  • Events -> Callbacks
  • Consolidate logoImageUrl and collapsedLogoImageUrl props into a single logo prop.

Props

| Name | Type | Description | Default Value | |------|------|-------------|---------------| | items | SidebarItemType[] | Array of sidebar items | [] | | recentActivity | Activity[] | Array of recent activities | [] | | configurationItem | Omit<SidebarItemType, 'type'> \| undefined | Configuration item, excluding 'type' | undefined | | contactUsItem | Omit<SidebarItemType, 'type'> \| undefined | Contact Us item, excluding 'type' | undefined | | userAccountItem | UserAccountSidebarItem \| undefined | User account item | undefined | | alwaysShowCategoryHeading | boolean | Flag to always show category heading | false | | signOutText | string | Text for the sign out option | 'Sign Out' | | expanded | boolean | Flag to expand or collapse the sidebar | true | | expandedText | string | Text for the expanded sidebar | 'Expand Sidebar' | | collapseSidebarText | string | Text for the collapsed sidebar | 'Collapse Sidebar' | | avatarImgClass | string | CSS class for the avatar image | '' | | activeState | Object | Object containing the active route and its parameters | { route: string, parameters: Record<string, string or undefined> } | | buildRoute | BuildRouteFn | Function to build the route | | | logo | Logo | The logo(s) to display above the sidebar. Can either be a string for a single logo, or an object containing multiple logos to show conditionally. | undefined |

Logo Type

The logo type lets you specify separate logos for when the sidebar is collapsed or expanded, including separate logos for dark/light mode. Or you can just specify one logo URL as a string.

type Logo = string | {
		collapsed: string
		expanded: string
		dark?: {
			collapsed: string
			expanded: string
		}
	}

Snippets

  • default - Essentially the remaining horizontal viewport space to the right of the sidebar. This is where the main views for your app will appear.
  • header - Full width horizontal bar shown at the very top of the page.
  • top - Just above the list of sidebar items, immediately following the logo image.

Callbacks

  • logout - Fired when the logout button is clicked.

Example

<script lang="ts">
	import Sidebar from '@isoftdata/svelte-sidebar'

	let sidebarExpanded: boolean
</script>

<Sidebar
	{activeState}
	buildRoute={asr.makePath}
	items={states}
	logo="./images/presage_white.svg"
	configurationItem={{ name: i18next.t('sidebar.configuration', 'Configuration'), icon: 'gear', route: 'app.configuration', parameters: {} }}
	userAccountItem={{
		route: 'app.configuration.user',
		parameters: {},
		userName: $session.userName,
		email: $session.user.workEmail,
		firstName: $session.user.firstName,
		lastName: $session.user.lastName,
	}}
	bind:expanded={sidebarExpanded}
	recentActivity={[]}
	logout={() => asr.go('login')}
>
	<uiView
		id="main-app"
		role="main"
		class="pl-0 pr-0"
	/>
</Sidebar>