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

@signalsafe/simulator-react

v0.1.3

Published

Reusable React device simulator shell, session state, and utilities (no routing or API)

Downloads

21

Readme

@signalsafe/simulator-react

React device simulator UI: SimulatorWithSession (and PhoneSimulatorShell), session state (getInitialSessionState, simulatorSessionReducer), template → payload adapter templateDetailToPayload, lint / deep-link / preview-fallback helpers, payload diff, and screen registry utilities. Build output is dist/; dependencies are listed in package.json.

Hosts supply a SimulatorTemplatePayload (typically by mapping API or template detail into that shape via templateDetailToPayload), then drive useReducer with simulatorSessionReducer (or simulatorSessionReducerWithLogging) and render SimulatorWithSession. Preset and fixture helpers are not part of the published package surface.

Install

npm install @signalsafe/simulator-react react react-dom react-bootstrap

Use a modern ESM TypeScript setup.

import 'bootstrap/dist/css/bootstrap.min.css';

Source layout (this package)

| Area | Location | |------|----------| | Main barrel | src/index.ts | | Session reducer | src/state/simulatorSessionReducer.ts | | Template → payload adapter | src/adapters/templateToSession.ts (templateDetailToPayload) | | Screen registry | src/screenRegistry/ | | Utilities | src/utils/ (lint, reachability, deep link, diff, contact search, …) |

Integration pattern

Convert template detail to a payload, validate and optionally apply preview fallback, build initial state, then render the shell and session:

import { useReducer } from 'react';
import {
    SimulatorWithSession,
    PhoneSimulatorShell,
    SimulatorLintBanner,
    templateDetailToPayload,
    getInitialSessionState,
    simulatorSessionReducerWithLogging,
    lintSimulatorPayload,
    parseSimulatorSearchParams,
    applyDeepLinkToState,
    getDeepLinkContactsSearch,
    applyPreviewFallback,
    type SimulatorSessionState,
    type SimulatorDispatchAction,
    type SimulatorInteractionEvent,
    type SimulatorTemplateDetail,
} from '@signalsafe/simulator-react';

// `SimulatorTemplateDetail` is defined in `src/types/portableSimulator.ts`.
function SimulatorHost({ detail }: { detail: SimulatorTemplateDetail }) {
    const rawPayload = templateDetailToPayload(detail, {});
    const payload = applyPreviewFallback(rawPayload);
    const lint = lintSimulatorPayload(payload);
    const initialState = getInitialSessionState(payload);
    const [state, dispatch] = useReducer(simulatorSessionReducerWithLogging, initialState);

    return (
        <PhoneSimulatorShell>
            {lint.messages.length > 0 ? <SimulatorLintBanner messages={lint.messages} /> : null}
            <SimulatorWithSession state={state} dispatch={dispatch} />
        </PhoneSimulatorShell>
    );
}

Search / deep links: parseSimulatorSearchParams, applyDeepLinkToState, and getDeepLinkContactsSearch align URL query state with session state.

Compare two payloads

import { diffSimulatorPayloads, type SimulatorDiffItem } from '@signalsafe/simulator-react';

const items: SimulatorDiffItem[] = diffSimulatorPayloads(leftPayload, rightPayload);

Interaction events (host typing)

import type { HostSimulatorEventHandler } from '@signalsafe/simulator-react';

const onSimulatorEvent: HostSimulatorEventHandler = (event) => {
    /* forward to your API or analytics */
};

<SimulatorWithSession state={state} dispatch={dispatch} onSimulatorEvent={onSimulatorEvent} />;

Developer tools panel

import { SimulatorDeveloperToolsPanel } from '@signalsafe/simulator-react';

<SimulatorDeveloperToolsPanel
    developerTools={{ preset: 'qa', sections: { reachability: true } }}
    payload={state.payload}
    timelineEntries={timelineEntries}
    runtimeIssues={runtimeIssues}
/>;

Subpath exports (package.json)

Imports outside the main barrel are explicit and versioned in exports:

| Import | Purpose | |--------|---------| | @signalsafe/simulator-react/utils/validateSimulatorPayload | JSON-schema style validation helper | | @signalsafe/simulator-react/utils/simulatorPreviewReport | Authoring / preview report builder |

Other deep import paths are unsupported.

Tests

Run the test script from this package directory (see package.json):

npm test

Boundaries

  • In scope: UI and state under src/, the main barrel, and the exports subpaths above (validate + preview report utilities only).
  • Out of scope: routing, HTTP clients, and transport — the package does not perform network I/O; host apps wire SimulatorTemplatePayload and onSimulatorEvent as needed.