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

insite-client-react

v1.1.2

Published

React UI components for inSite client (Subject, ContextMenu, Collapse)

Downloads

240

Readme

insite-client-react

React components for displaying subjects (users and organizations), context menus, and collapse animations.

Part of inSite — uses insite-users-client for Subject live updates.

Installation

npm install insite-client-react

Or:

bun add insite-client-react

Requirements

Bundler aliases (resolve in your build config):

  • $styles — object with createStyles and theme for styling
  • $app — object with usersSubscriptionGroup (used by Subject for live updates; from insite-users-client)

Host app dependencies: Subject and ContextMenu use Material UI v4 (@material-ui/core) and @nesvet/missing-mui4-components. Install these in your app.

Quick Start

import { Collapse, Subject, ContextMenu, ContextMenuItem } from "insite-client-react";

<Collapse in={isOpen}><p>Content</p></Collapse>
<Subject for={user} size="m" />

const menuRef = useRef();
<div onContextMenu={(e) => menuRef.current?.open({ event: e })}>Right-click me</div>
<ContextMenu ref={menuRef}>
  <ContextMenuItem onClick={handleCopy}>Copy</ContextMenuItem>
</ContextMenu>

API Reference

Exports

| Import | Contents | |--------|----------| | insite-client-react | All components and shared utilities | | insite-client-react/Subject | Subject, Avatar, Details, EditableAvatar, AvatarDialog | | insite-client-react/ContextMenu | ContextMenu, Item, Divider, SubMenuItem, Title |

Shared

Types: PolymorphicRef<C>, PolymorphicProps<C, Props>, PolymorphicComponent<Default, Props>

css: createSheet(css: string): SheetAccessor — lazy singleton for adopted stylesheets; useSheet(getSheet, root?) — mounts/unmounts sheet in layout effect

env: isDev: booleanprocess.env.NODE_ENV !== "production"

Collapse

Polymorphic collapse component with CSS transitions.

| Prop | Type | Default | Description | |------|------|---------|-------------| | in | boolean | — | Open state | | orientation | "both" \| "horizontal" \| "vertical" | "vertical" | Collapse direction | | fade | boolean | — | Fade opacity when closed | | as | ElementType | "div" | Polymorphic root element | | className | string | — | Additional class | | style | CollapseCSSVars & CSSProperties | — | Override --is-collapse-duration, --is-collapse-easing |

Subject

Composite layout for user or org: avatar plus details.

| Prop | Type | Default | Description | |------|------|---------|-------------| | for | User \| Org | {} | Subject data | | vertical | boolean | — | Vertical layout | | size | "xxs" \| "xs" \| "s" \| "m" \| "l" \| "xl" | "m" | Size preset | | name | boolean | true | Show name | | title | boolean | true | Show title (org) | | job | boolean | true | Show job (user) | | avatar | boolean \| ReactNode | true | Avatar slot | | details | boolean | true | Details slot | | online | boolean | true | Show online indicator | | tooltip | boolean | false | Avatar tooltip | | disableAutoUpdate | boolean | — | Disable subscription updates | | AvatarProps | object | — | Passed to Avatar | | DetailsProps | object | — | Passed to Details |

Avatar — user or org avatar. Props: for, size, online, tooltip, disableAutoUpdate

Details — user or org details. Props: for, vertical, size, name, job, title, disableAutoUpdate

EditableAvatar — avatar with dropzone and context menu (upload/delete). Props: person, size, online, editable, disablePortal, ws, dialog, self, label strings

AvatarDialog — modal for cropping and rotating avatars. Uses ws.transfer() and react-avatar-editor

Subject data shape: User — { _id, name: { first, last }, job, displayLabel, initials, avatarUrl, isOnline }; Org — { _id, title, displayLabel, initials, avatarUrl, isOrg: true }

ContextMenu

Imperative menu. Open via ref.open({ event, anchor, prepend, append, onClose }, context).

| Prop | Type | Description | |------|------|-------------| | contextField | string | Default "ctx" — field on ref that holds context | | children | ReactNode \| (context, menu) => ReactNode | Menu content | | onOpen | () => void | Called when opened | | onClose | () => void | Called when closed |

ContextMenuItem — menu item. Props: label, children, onClick, and other MenuItem props

ContextMenuDivider — visual separator

ContextMenuTitle — section title. Props: children, className

ContextMenuSubMenuItem — item that opens nested submenu. Props: label, children (submenu items), MenuProps, onClick

Usage Examples

import { Collapse } from "insite-client-react";
<Collapse in={isOpen}><p>Content that expands and collapses</p></Collapse>

import { Subject } from "insite-client-react";
<Subject for={user} size="m" />

import { ContextMenu, ContextMenuItem } from "insite-client-react";
const menuRef = useRef();
<div onContextMenu={(e) => menuRef.current?.open({ event: e })}>Right-click me</div>
<ContextMenu ref={menuRef}>
  <ContextMenuItem onClick={handleCopy}>Copy</ContextMenuItem>
  <ContextMenuItem onClick={handlePaste}>Paste</ContextMenuItem>
</ContextMenu>

Related

License

MIT