ServerSideUp branded toolbar with product navigation for documentation sites. Displays the ServerSideUp logo, a "Browse Products" dropdown with Premium/Books/Open Source sections, navigation links, and social icons.
yarn add @serversideup/project-switcher-barSince the component lives in node_modules, Tailwind v4 needs to be told to scan it for utility classes. Add a @source directive to your main CSS file:
@import "tailwindcss";
@source "../node_modules/@serversideup/project-switcher-bar/src";<script setup>
import { ProjectSwitcherBar } from '@serversideup/project-switcher-bar'
</script>
<template>
<ProjectSwitcherBar />
</template>The component ships pre-compiled — no special build configuration needed in your project.
If your project has a local ServerSideUp.vue component (the old hardcoded toolbar), follow these steps:
yarn add @serversideup/project-switcher-barIn your main CSS file (e.g. app/assets/css/main.css), add:
@source "../node_modules/@serversideup/project-switcher-bar/src";Replace the old component with an explicit import:
<script setup>
+ import { ProjectSwitcherBar } from '@serversideup/project-switcher-bar'
</script>
<template>
<UApp>
<NuxtLoadingIndicator />
- <ServerSideUp />
+ <ProjectSwitcherBar />
<AppHeader />Note: If your project uses the
Global/directory convention (e.g. Spin docs), replace<GlobalServerSideUp />instead.
Remove the old file from whichever location it lives in your project:
# docker-php, amplitudejs, etc.
rm app/components/ServerSideUp.vue
# spin (uses Global/ subdirectory)
rm app/components/Global/ServerSideUp.vueThe old ServerSideUp.vue used onClickOutside from VueUse. This package uses a native document.addEventListener instead, so if onClickOutside was the only reason you had @vueuse/nuxt installed, you can remove it:
yarn remove @vueuse/nuxtThen remove '@vueuse/nuxt' from the modules array in nuxt.config.ts.
- The component is pre-compiled to plain JS via Vite library mode (
dist/index.mjs) — works in any Vue/Nuxt project without needing to transpile.vuefiles - Product and open source data is baked into
src/data.json(auto-updated by CI from the main serversideup.net content) - Logos are embedded as base64 data URIs — no external assets needed
- Navigation links and social icons are hardcoded in the component
- Uses
<a>tags (not<NuxtLink>) so it works in any Vue project - The
src/directory is included for Tailwind v4 class scanning via@source
To automatically receive PRs when a new version is published, add .github/dependabot.yml to your sub-project:
version: 2
updates:
- package-ecosystem: "npm"
directory: "/docs"
schedule:
interval: "daily"
allow:
- dependency-name: "@serversideup/project-switcher-bar"Note: Change
directoryto match the location of yourpackage.json(e.g."/"if it's at the repo root,"/docs"if it's in a docs subdirectory).
The allow key restricts Dependabot to only open PRs for this package. Without it, Dependabot would propose updates for all your npm dependencies.
The src/data.json file is automatically updated by GitLab CI when products or open source projects change on serversideup.net. A GitHub Action then rebuilds dist/, bumps the version, and publishes to npm automatically.
yarn install
yarn devOpens a Vite dev server with a preview page rendering the component.
yarn buildCompiles the Vue component to dist/index.mjs. This is done automatically by the GitHub Action when src/ changes on main.
MIT