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

@stratton-cologne/ui

v1.6.0

Published

Headless Vue 3 Komponenten (**ohne CSS**). Optional **Zero‑Config i18n** (automatische `vue-i18n`‑Erkennung via `globalInjection`). **Wildcard Subpath Exports** – keine per‑Komponente `exports` in der `package.json` nötig.

Downloads

12

Readme

@stratton-cologne/ui

Headless Vue 3 Komponenten (ohne CSS). Optional Zero‑Config i18n (automatische vue-i18n‑Erkennung via globalInjection). Wildcard Subpath Exports – keine per‑Komponente exports in der package.json nötig.


Features

  • Headless/Renderless: Keine Styles, keine Klassen – Styling komplett in der Consumer‑App.
  • Zero‑Config i18n (optional): Nutzt app.config.globalProperties.$t (wenn vue-i18n mit globalInjection: true eingebunden ist). Fallbacks, wenn kein i18n vorhanden.
  • Wildcard Subpath Exports: @stratton-cologne/ui/<alias> ohne jede Einzelpflege in package.json.
  • Auto‑Entries: Kleines Skript generiert src/entries/*.ts aus src/components/*.vue und einer optionalen entries.map.json.
  • Vue 3 + Vite (Library Mode): ES/UMD Builds, Typs (.d.ts) inklusive; vue, vue-router, vue-i18n als Peer‑Deps.
  • SSR‑safe: Composables prüfen DOM/Storage.

Installation

pnpm add @stratton-cologne/ui
# optional für Übersetzungen
pnpm add vue-i18n

i18n Zero‑Config Setup (Consumer‑App)

// main.ts
import { createApp } from "vue";
import { createI18n } from "vue-i18n";
import App from "./App.vue";

const messages = {
    de: {
        "sc.ui": {
            breadcrumb: {
                ariaLabel: "Brotkrumen",
                separator: "/",
                items: { home: "Start", products: "Produkte" },
            },
        },
    },
};

const i18n = createI18n({
    legacy: false,
    globalInjection: true,
    locale: "de",
    messages,
});

createApp(App)
    .use(i18n) // keine weitere UI-Plugin-Registrierung nötig
    .mount("#app");

Ohne i18n funktioniert das Paket mit Fallback‑Strings (z. B. 'Breadcrumb', '›').


Imports (Wildcard Subpaths)

Kein manuelles Pflegen von exports mehr. Jede gebaute Datei in dist ist als Subpath importierbar:

import ThemeSwitcher from "@stratton-cologne/ui/theme-switcher";
import Breadcrumb from "@stratton-cologne/ui/breadcrumb";

Zusätzlich existiert ein bequemer Root‑Default (zeigt auf ThemeSwitcher):

import ThemeSwitcher from "@stratton-cologne/ui";

Quickstart im Template

<script setup lang="ts">
import ThemeSwitcher from "@stratton-cologne/ui/theme-switcher";
import Breadcrumb from "@stratton-cologne/ui/breadcrumb";
</script>

<template>
    <ThemeSwitcher v-slot="{ isDark, toggle }">
        <button class="btn" @click="toggle">{{ isDark ? "🌙" : "☀️" }}</button>
    </ThemeSwitcher>

    <Breadcrumb class="my-breadcrumb" />
</template>

Styling: Dieses Paket liefert keine CSS‑Klassen. Nutze Tailwind/UnoCSS/SCSS/vanilla nach Bedarf.


Komponenten

<Breadcrumb> (headless, router‑aware, i18n‑aware)

Props

  • items?: { path?: string; labelKey?: string; label?: string }[]
  • fromRouter?: boolean – default: true (zieht Einträge aus vue-router)
  • ariaLabel?: string – überschreibt ARIA‑Label (sonst i18n breadcrumb.ariaLabel → Fallback 'Breadcrumb')
  • separator?: string – überschreibt Separator (sonst i18n breadcrumb.separator → Fallback '›')

Slots

  • item{ item, index, isLast } (Markup/Styling durch Consumer)
  • separator – eigener Separator zwischen Items

Hinweise

  • labelKey löst sc.ui.breadcrumb.items.<labelKey> auf; Fallback: label bzw. labelKey.

Beispiel Styling

.my-breadcrumb ol {
    display: flex;
    gap: 0.5rem;
}
.my-breadcrumb a {
    text-decoration: none;
}
.my-breadcrumb .separator {
    opacity: 0.6;
}

<ThemeSwitcher> (alias von <ThemeToggle>; renderless)

Slot Props { theme, isDark, toggle, setTheme }

Composable: useTheme()

  • Setzt data-theme="light|dark" und toggelt html.dark.
  • Persistiert Auswahl in localStorage (Key: app.theme).

Auto‑Entries & Aliase

Beim Build wird vorab scripts/generate-entries.mjs ausgeführt und legt src/entries/*.ts an.

  • Ohne Konfiguration: Jeder Component‑Dateiname (z. B. ThemeToggle.vue) ist automatisch unter seinem kebab‑case Subpath verfügbar (@stratton-cologne/ui/theme-toggle).
  • Mit Alias‑Map: Lege optional eine entries.map.json an, um Wunsch‑Aliase zu definieren.

Beispiel entries.map.json

{
    "theme-switcher": "ThemeToggle.vue",
    "breadcrumb": "Breadcrumb.vue"
}

TypeScript & Tree‑Shaking

  • Typs (.d.ts) werden generiert.
  • exports: { "./*": "./dist/*.es.js" } + typesVersions → saubere Subpath‑Typauflösung.
  • Peer‑Deps halten das Bundle klein: vue, vue-router, vue-i18n (i18n optional).

Build lokal

pnpm run build
# führt automatisch: scripts/generate-entries.mjs → vite build

Lizenz

MIT © Stratton Cologne


Changelog