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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@micrio/client-react

v0.1.2

Published

Wrapper for the Micrio client library for React.

Downloads

21

Readme

Micrio Client React Wrapper

NPM Version License React Version

Micrio is a platform for creating interactive, high-resolution image experiences. This NPM package (@micrio/client-react) provides a React component that wraps the core Micrio Client JS library (Github), making it easy to integrate Micrio viewers into your React applications.

It's fully Typescript-compatible, offering a great development experience for Typescript-React projects.

If you are looking for HOWTOs, tutorials, or general Micrio help, please check out our searchable Knowledge Base.

Requirements

  • Node.js: >=18.17.0
  • React: ^18.0.0
  • React DOM: ^18.0.0

Installation

npm i @micrio/client-react

Usage

Basic Example

import React from 'react';
import { Micrio } from '@micrio/client-react';

const App = () => {
	return (
		<div style={{ width: '800px', height: '600px' }}>
			<Micrio id="aBcDeFg" /> {/* Replace with your Micrio Image ID */}
		</div>
	);
};

export default App;

Handling Events

You can pass event handlers directly as props. The available events are documented in the Micrio Client Events documentation.

import React, { useCallback } from 'react';
import { Micrio } from '@micrio/client-react';

const App = () => {
	return (
		<div style={{ width: '800px', height: '600px' }}>
			<Micrio
				id="aBcDeFg"
				onShow={e => {
					const micrioInstance = e.detail;
					console.log('Micrio show', micrioInstance.$current?.camera.flyToCoo([0.5, 0.5]));
				}}
			/>
		</div>
	);
};

export default App;

Initial Settings

Pass initial runtime settings as props. See the Micrio Client Runtime Settings documentation for all available options.

import React from 'react';
import { Micrio } from '@micrio/client-react';

const App = () => {
	return (
		<div style={{ width: '800px', height: '600px' }}>
			<Micrio
				id="aBcDeFg" // Replace with your Micrio Image ID
				dataUi={false} // Example: Start with UI hidden
			/>
		</div>
	);
};

export default App;

Component Props & API

The <Micrio /> component accepts the following key props:

  • id (string, required): The Micrio Image ID.
  • className (string, optional): CSS class name for the container div.
  • style (object, optional): Inline styles for the container div. Defaults to { width: '100%', height: '100%' }.
  • Event Handlers: Functions corresponding to Micrio client events (e.g., onShow, onPreData, onZoom, onTourStart). The onShow handler receives the MicrioInstance as its argument.
  • Runtime Settings: Most other props are passed directly to the Micrio client as initial runtime settings (e.g., dataUi, dataLogo, dataPath). Refer to the Micrio documentation for details.

Important Note on Initial Settings Props!

Almost all Micrio-specific runtime props are applied only when the component mounts. The underlying Micrio client does not support dynamically changing most of these settings after initialization. If you need to change a setting like dataUi from false to true, you will need to unmount and remount the <Micrio /> component with the new prop value. The id prop can be changed dynamically, which will load a new Micrio image. The muted prop can also be changed, muting/unmuting audio in the element.

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork & Clone: Fork the repository and clone it locally.
  2. Install: npm install
  3. Develop: Run the development server: npm run dev (available at http://localhost:2000)
  4. Build: Create a production build: npm run build
  5. Submit PR: Create a pull request with your changes. Please ensure Micrio still works well when running npm run dev and that the code is formatted correctly.

Feel free to open an issue for bug reports or feature requests.

Repository

License

This project is licensed under the MIT License. See the LICENSE file for details.