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

@embeddedchat/ui-elements

v0.1.3

Published

Reusable UI components and UI-related hooks for EmbeddedChat.

Readme

Embedded Chat: A Staple in Excellent Customer Service

The Embedded Chat component is an easy-to-use, full-stack solution for integrating Rocket.Chat into your web application. It combines React.js with backend behaviors for a seamless chat experience.

Embedded Chat Demo

UI Elements

This component is part of a monorepo, specifically within the packages/react project, which houses the main EmbeddedChat Component.

image

Try It Out 🚀

Check out our Storybook showcasing all the components in action! Preview and test them here: https://rocketchat.github.io/EmbeddedChat/ui-elements/

Development

To develop and view the components:

  1. Clone the repository.

  2. Navigate to packages/ui-elements.

  3. Run the following commands:

    yarn build       # To build the component library
    yarn storybook   # To view the components in real-time

Installation

To install the component library, run:

yarn add @embeddedchat/ui-elements

This library offers a range of UI components, including Box, Input, StaticSelect, MultiSelect, and more. For a complete list of available components, please refer to the Storybook.

You can import components using the following syntax:

import {
  Box,
  Heading,
  Icon,
  Menu,
  useToastBarDispatch,
  useComponentOverrides,
} from '@embeddedchat/ui-elements';

### Theming

By default, the component uses a standard theme. You can apply a custom theme and mode by importing `ThemeProvider` from `@embeddedchat/ui-elements` and using it as follows:

```jsx
import { ThemeProvider } from "@embeddedchat/ui-elements";

<ThemeProvider theme={customTheme} mode="light">
  <YourMainComponent />
</ThemeProvider>;

Supported modes are 'light' and 'dark'. Ensure that the theme prop is provided with the correct format.

The library also includes a useTheme hook for managing the theme and mode:

import { useTheme } from "@embeddedchat/ui-elements";

const { theme, mode, setTheme, setMode } = useTheme();

The useTheme hook provides:

  • theme: The current theme object.
  • mode: The current mode ('light' or 'dark').
  • setTheme: A function to update the theme dynamically.
  • setMode: A function to toggle between 'light' and 'dark' modes.

setTheme allows you to change the theme on-the-fly, while setMode lets you switch between light and dark modes. This flexibility is useful for dynamically adjusting the appearance of your application based on user preferences or other conditions.

You can use this hook to style your components with the provided theme. useTheme() also provides colors and invertedColors, simplifying color management. colors will automatically adjust according to the mode, while invertedColors provides colors for the alternate mode.

Additionally, the library offers darken and lighten functions to dynamically adjust color brightness:

import { darken, lighten } from "@embeddedchat/ui-elements";

These functions can be used as follows:

background-color: ${mode === 'light'
      ? darken(colors.background, 0.03)
      : lighten(colors.background, 1)};

This hook allows you to dynamically switch modes or themes as needed. The theme object must adhere to a specific format, as outlined in the theming guide.