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

@carissa-io/components-tree

v0.1.1

Published

Carissa UI: WAI-ARIA tree view with roving tabindex, typeahead and controlled or uncontrolled selection as React components with SCSS variables

Readme

@carissa-io/components-tree

Tree: Tree and TreeItem. The WAI-ARIA tree view: nested nodes, roving tabindex, full keyboard support and typeahead, with controlled or uncontrolled selection and expansion. A React component set, SCSS-themed, with no other dependency.

npm i @carissa-io/components-tree

Use

import { Tree, TreeItem } from '@carissa-io/components-tree'

<Tree label={t('files')} default_expanded={['docs']} on_select={(value) => open(value)}>
    <TreeItem value="docs" label={t('documents')} icon={<FolderIcon />}>
        <TreeItem value="cv" label="CV.pdf" />
        <TreeItem value="notes" label={t('notes')} disabled />
    </TreeItem>
    <TreeItem value="readme" label="README.md" />
</Tree>

| Part | Prop | | |---|---|---| | Tree | label | the accessible name (aria-label); aria-labelledby can be passed instead | | | selected, on_select(value) | controlled selection (null means none); without selected the tree keeps its own state | | | default_selected | the initial selection when uncontrolled | | | expanded, on_expanded_change(values) | controlled list of open parents; without expanded the tree keeps its own state | | | default_expanded | the initial open parents when uncontrolled (default []) | | TreeItem | value | the item's string identity (used by selected and expanded) | | | label | the text; it names the item and drives typeahead | | | icon | a leading node, rendered aria-hidden | | | disabled | aria-disabled: skipped by the keys, not selectable, not toggleable | | | children | other TreeItems; makes it a parent |

className is appended on both parts; unknown props go to the ul on Tree and to the li on TreeItem. on_select receives the value; on_expanded_change receives the full new array of open values. Children of a closed parent are not rendered. Clicking a row selects it and toggles it when it is a parent.

Accessibility

Follows the WAI-ARIA authoring practices tree view: role="tree", treeitem, children in role="group", aria-expanded on parents only, aria-selected on every item. One item is in the tab order (roving tabindex): the focused one, else the selected one, else the first enabled one.

| Key | Action | |---|---| | Down / Up | next / previous visible item | | Right | open a closed parent; on an open parent, go to its first child | | Left | close an open parent; otherwise go to the parent | | Home / End | first / last visible item | | Enter / Space | select the item | | * | open every closed sibling of the focused item | | a character | jump to the next item whose label starts with the typed text (the buffer resets after 500 ms; repeating one letter cycles) |

Disabled items are skipped by every key. The chevron is CSS on the aria-hidden c-tree__toggle span (parents only; it turns down when open), coloured with $c-tree-toggle-color. Give the tree a label.

Style

@use '@carissa-io/components-tree/scss' with (
    $c-tree-indent: 1.5rem,
    $c-tree-row-background-selected: #eef
);

Classes: c-tree, c-tree__item (--parent, --open, --selected, --disabled), c-tree__row, c-tree__toggle, c-tree__icon, c-tree__label and c-tree__group. Every variable is !default (see scss/_variables.scss); the defaults are neutral, so the component works without a theme. Transitions are disabled with prefers-reduced-motion.

| Variable | Default | |---|---| | $c-tree-font-size | 1rem | | $c-tree-row-padding-x, $c-tree-row-padding-y | 0.5rem, 0.25rem | | $c-tree-row-gap, $c-tree-row-radius, $c-tree-indent | 0.375rem, 0.25rem, 1.25rem | | $c-tree-toggle-size, $c-tree-toggle-chevron-size, $c-tree-toggle-chevron-width, $c-tree-toggle-color | 1rem, 0.4375rem, 2px, currentColor | | $c-tree-row-background-hover, $c-tree-row-background-selected | rgb(0 0 0 / 0.04), rgb(0 0 0 / 0.08) | | $c-tree-row-color-selected, $c-tree-item-disabled-opacity | inherit, 0.5 | | $c-tree-focus-outline, $c-tree-focus-outline-offset | 2px solid currentColor, -2px | | $c-tree-transition-duration | 0.15s |