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

@texuli/primitives

v0.18.0

Published

Owned, headless Svelte 5 primitives built on the texels.

Readme

@texuli/primitives

Owned, headless Svelte 5 primitives from Texuli, an MIT-licensed component library by Dailybot, Inc. (Small pieces. Infinite possibilities.). Each primitive implements the behavior of a WAI-ARIA Authoring Practices pattern (roles, keyboard, focus, dismissal, form participation) and renders unstyled markup, so you bring your own design.

In the stack: layer L1: owned headless primitives on the @texuli/core texels (plus @texuli/date and @texuli/drag). The texuli components (L3) and the domain packages build on them.

Use it when you are building a design system or styled components on Svelte 5 and want accessible behavior you do not have to write yourself. For ready-styled components, use texuli, which is built on these primitives. They are built from scratch on the @texuli/core texels and do not depend on any other component library.

Status: 0.x release. Texuli is in development. The packages are published to npm as 0.18.0, a pre-1.0 release (1.0.0 will be the first stable release). Under 0.x, a new minor (0.18.0) may contain breaking changes, so pin the exact version or use ^0.18.0, which accepts only 0.18.x.

Install

npm install @texuli/primitives
pnpm add @texuli/primitives
# or
yarn add @texuli/primitives
  • Peer dependency: svelte ^5.57.2.
  • Bundler: the package ships Svelte components, so use a Svelte 5 aware setup: Vite with @sveltejs/vite-plugin-svelte, SvelteKit, or Astro with @astrojs/svelte.
  • CSS: none. The primitives are headless; style them with your own classes.

Quick start

Every primitive is a compound component. Import it as a namespace from its subpath:

<script lang="ts">
  import * as Dialog from '@texuli/primitives/dialog';

  let open = $state(false);
</script>

<Dialog.Root bind:open>
  <Dialog.Trigger>Open settings</Dialog.Trigger>
  <Dialog.Portal>
    <Dialog.Overlay class="dialog-backdrop" />
    <Dialog.Content class="dialog-panel">
      <Dialog.Title>Settings</Dialog.Title>
      <Dialog.Description>Manage your workspace preferences.</Dialog.Description>
      <Dialog.Close>Done</Dialog.Close>
    </Dialog.Content>
  </Dialog.Portal>
</Dialog.Root>

The dialog traps focus, makes the rest of the page inert, locks scrolling, closes on Escape or a backdrop press, and returns focus to the trigger. The backdrop and panel styles are yours.

The root entry (@texuli/primitives) re-exports every primitive; import from subpaths to keep bundles narrow.

What's inside

42 primitives, one subpath each (@texuli/primitives/<subpath>):

| Purpose | Subpaths | | --- | --- | | Overlays | dialog, alert-dialog, sheet, popover, hover-card, tooltip, toast, portal | | Menus and navigation | menu, context-menu, menubar, navigation-menu, command, toolbar, tabs, pagination | | Selection and lists | select, combobox, listbox, tree, sortable (new in 0.4.0) | | Form controls | label, checkbox, switch, radio-group, toggle, slider, number-field, pin-input, tags-input, color-picker, file-drop | | Dates | calendar, date-field, date-picker | | Disclosure and layout | accordion, collapsible, splitter, scroll-area, separator | | Display | avatar, progress |

Key guarantees

  • WAI-ARIA Authoring Practices. Each primitive follows its APG pattern for roles, states and keyboard interaction, and each is exercised by a browser behavior suite covering keyboard, focus, ARIA and axe checks.
  • Shared layering. Escape reaches only the topmost layer, so nested dialogs, menus and popovers close in order; overlays portal through one implementation.
  • Your handlers add, never replace. A handler you pass to a part that binds its own (onclick on a radio item, tab or toggle, onkeydown on a listbox or calendar grid, oninput on the pin input…) runs first, and the part's behavior still runs; call event.preventDefault() in a click or key handler to skip it. Bookkeeping handlers (focus, input, pointer up) always run. Handlers a part fully owns are left out of its prop types. The two composers are public from @texuli/primitives for parts you build yourself: composeHandlers(callerHandler, own) (own is skipped when the caller called preventDefault()) and chainHandlers(callerHandler, own) (own always runs).
  • bind:ref and rest attributes on every part. Every part that renders an element takes bind:ref (that element) and puts the attributes it does not consume on it. Roots that only hold state (menu, select, popover, dialog, tooltip roots) and portals render no element and take neither. tests/contract.test.ts checks every exported part (Component API contract).
  • Your ids win. An id you pass on any part replaces the generated one, and every aria-* reference to that part follows it.
  • Native forms. Checkbox, switch, radio group, select, combobox, slider, number field and tags input participate in native <form> submission.
  • Right-to-left. Composite widgets read the document direction and mirror horizontal arrow keys in right-to-left layouts.
  • Safe sources. Avatar images and toolbar and navigation-menu links pass the core URL policy. Avatar images default to the untrusted tier; links default to developer, so set hrefTrust="untrusted" for agent or user content.
  • No HTML sinks. Content renders through Svelte snippets and text, never {@html}.
  • Dependency-free dates. calendar, date-field and date-picker compute dates with @texuli/date and label them with Intl.DateTimeFormat. Only the Gregorian calendar is supported; CalendarDate is re-exported from @texuli/date.

New in 0.8.0

Ships in 0.8.0; the 0.7.0 release predates it: the labels primitives write themselves resolve through the @texuli/core/i18n message catalog (ADR-016): setI18nContext, useMessages and PRIMITIVES_MESSAGES_EN (every label id with its English default); instance props keep winning, and English is the default (opt-in Spanish catalogs from 0.14.3, in texuli/i18n/es) (i18n).

New in 0.6.0

Ships in 0.6.0; the 0.5.0 release predates it. Under 0.x the new minor may break; see RELEASE.

  • One API contract: bind:ref on every rendering part (menus, combobox, select, popover, navigation menu, sheet, command, radio, number field, tooltip and the rest) and rest attributes on its root, checked by tests/contract.test.ts over every export (STANDARDS).
  • Caller handlers compose on more parts (caller first; event.preventDefault() skips the part's action): menu items (focus and blur; every handler of checkbox and radio items and sub-triggers), the navigation menu root, list, trigger and link, toast roots and viewports, the tree, splitter handles and the command input.
  • Motion hooks: overlay contents take motionHooks (enter, and an exit that keeps the closed part mounted and inert until it ends) (prim-dialog).
  • TagsInput.Root readonly and a list or RegExp delimiter (isDelimiterKey, G60, G61); DateField.Root and TimeField.Root inputId, with aria-describedby and aria-invalid on their segments (G63); calendar onFocusedValueChange (G64); a date only for a four-digit year (G65, breaking); DateRangePicker.Field required and onInvalid(text, reason, { side }) (G66); toast viewports active, mode="contained" and container (G77); the avatar's loading image hidden by style, never [hidden] (G79); backdrops that stay under overlays opened inside a modal (G75).
  • ScrollArea.Corner forceMount, Command.Input onkeydown, and rest attributes on CollapsibleContent and NavigationMenu.Content.
  • AccordionRootProps and SliderRootProps members are type aliases a consumer's checker can key (TS2590).

New in 0.5.0

Ships in 0.5.0 (the 0.4.0 release predates it): caller handlers compose with the parts' own instead of replacing them, the date-field TimeField spins with the APG spinbutton keys, the calendar and date picker's today, weekStartsOn and range options, ToggleGroup name and its first-pressed Tab stop, and PinInput.Root name and inputRef (prim-calendar, prim-date-field, prim-toggle).

New in 0.4.0

sortable (Sortable.Root, List, Item, Handle) ships in 0.4.0; it is not in 0.3.0. It binds the drag engine @texuli/drag, which is in development and on npm in the 0.18 line (RELEASE). Contract: prim-sortable.md.

Breaking in 0.3.0

@texuli/primitives no longer depends on @internationalized/date. CalendarDate now comes from @texuli/date, and CalendarIdentifier is narrowed to 'gregory', so code that passed another calendar system (or a CalendarDate built with @internationalized/date) must move to @texuli/date. The calendar entry fell from about 13.05 to 5.15 KiB gzip and the date picker from about 28.60 to 20.26 KiB.

Documentation

Related packages

  • @texuli/core: the framework-free behavior these primitives are built on.
  • @texuli/date: the dependency-free Gregorian dates behind the calendar and date pickers.
  • texuli: styled components built on these primitives.
  • @texuli/tokens: the theme engine and design tokens.

Contributing

Source, issues and contribution guidelines live at github.com/DailybotHQ/texuli. Report bugs at github.com/DailybotHQ/texuli/issues.

License

MIT © Dailybot, Inc. Powered by Dailybot.