🚀. Socket Launch Week Day 2:Introducing Manifest Alerts.Learn more
Sign In

@isoftdata/svelte-sidebar

Package Overview
Dependencies
Maintainers
12
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@isoftdata/svelte-sidebar

latest
npmnpm
Version
2.0.18
Version published
Weekly downloads
85
-94.92%
Maintainers
12
Weekly downloads
 
Created
Source

Svelte Sidebar

alt text

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

NameTypeDescriptionDefault Value
itemsSidebarItemType[]Array of sidebar items[]
recentActivityActivity[]Array of recent activities[]
configurationItemOmit<SidebarItemType, 'type'> | undefinedConfiguration item, excluding 'type'undefined
contactUsItemOmit<SidebarItemType, 'type'> | undefinedContact Us item, excluding 'type'undefined
userAccountItemUserAccountSidebarItem | undefinedUser account itemundefined
alwaysShowCategoryHeadingbooleanFlag to always show category headingfalse
signOutTextstringText for the sign out option'Sign Out'
expandedbooleanFlag to expand or collapse the sidebartrue
expandedTextstringText for the expanded sidebar'Expand Sidebar'
collapseSidebarTextstringText for the collapsed sidebar'Collapse Sidebar'
avatarImgClassstringCSS class for the avatar image''
activeStateObjectObject containing the active route and its parameters{ route: string, parameters: Record<string, string or undefined> }
buildRouteBuildRouteFnFunction to build the route
logoLogoThe 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>

FAQs

Package last updated on 04 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts