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

@lilydesignsystem/svelte-text-size-picker

v0.1.1

Published

Lily Design System - Svelte 5 text size picker

Readme

TextSizePicker (Svelte helper)

A reusable Svelte 5 headless text-size picker — an icon button that opens a WAI-ARIA APG listbox of text-size slugs. On every change it sets data-text-size="{slug}" on a target element (default document.documentElement), optionally persisting the choice to localStorage. Ships no CSS — the consumer maps each size slug to real typography via CSS, e.g.:

:root[data-text-size="small"] {
  font-size: 87.5%;
}
:root[data-text-size="medium"] {
  font-size: 100%;
}
:root[data-text-size="large"] {
  font-size: 112.5%;
}
:root[data-text-size="x-large"] {
  font-size: 125%;
}

This supports WCAG 2.2 — 1.4.4 (Resize Text) and 1.4.12 (Text Spacing) — by letting users pick a comfortable reading size that the app remembers.

Usage

<script lang="ts">
  import TextSizePicker from "@lilydesignsystem/svelte-text-size-picker";
  let size = $state("");
</script>

<TextSizePicker
  label="Text size"
  sizes={["small", "medium", "large", "x-large"]}
  bind:value={size}
  storageKey="lily-text-size"
/>

Props

| Prop | Type | Required | Description | | -------------- | ------------------------ | -------- | ------------------------------------------------------ | | label | string | yes | Accessible name (aria-label) for the <select>. | | sizes | string[] | yes | Available size slugs. | | value | string | no | Selected slug. Two-way bindable. | | defaultValue | string | no | Initial slug when nothing else is supplied. | | storageKey | string | no | If set, persist the slug to localStorage. | | name | string | no | name of the <select> (default "text-size"). | | target | HTMLElement \| null | no | Element to receive data-text-size. Default <html>. | | sizeLabels | Record<string,string> | no | Pretty labels per slug. | | onChange | (size: string) => void | no | Called after a new size is applied. | | class | string | no | Extra CSS class on the root <select>. |

Behaviour

Initial value resolves from value > storage > defaultValue > "medium" (if present) > sizes[0]. All DOM writes happen inside $effect, so the component is SSR-safe.

Accessibility

  • WCAG 2.2 AAA target.
  • APG listbox keyboard contract: arrows (clamped), Home / End, PageUp / PageDown (by ten), typeahead with same-character cycling, Escape discards, and Tab closes via the button so the default Tab proceeds from the picker's position.
  • aria-label carries the consumer-supplied accessible name.
  • Default labels title-case the slug.

Lily™ and Lily Design System™ are trademarks.