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

@theniledev/react

v1.0.0-alpha.194

Published

## Storybook

Readme

@theniledev/react

Storybook

Storybook

Usage

In the root of your react application, add a Nile provider. This will add a QueryClientProvider and a CssVarsProvider to your application.

import { NileProvider } from '@theniledev/react';

function App() {
  return (
    <NileProvider>
      <div>Welcome to my great app</div>
    </NileProvider>
  );
}

Once added, there is a hook and components available for use. It is recommended to place the <NileProvider /> as high up in your render tree as possible, since it contains both stying and request wrappers.

Dependencies

React query

The components of this library use react-query to request data. The <QueryClientProvider /> used can be customized via the optional QueryProvider prop of the <NileProvider />.

import { QueryClient, QueryClientProvider } from 'react-query';

const queryClient = new QueryClient({
  defaultOptions: {
    queries: {
      retry: false,
      refetchOnWindowFocus: false,
    },
  },
});

function MyQueryProvider({ children }) {
  return (
    <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
  );
}

function App() {
  return (
    <NileProvider QueryProvider={MyQueryProvider}>
      <div>Welcome to my great app</div>
    </NileProvider>
  );
}

@mui/joy

Out of the box mui joy is available for use. No set up is required, simply add the dependencies to your code, then use components and functions provided by those libraries.

A custom theme can be given to the NileProvider, which will theme all components:

function App() {
  return (
    <NileProvider theme={theme}>
      <div>Welcome to my great app</div>
    </NileProvider>
  );
}

useNile

A method exposing the @theniledev/js instance created in <NileProvider />. The methods on the instance can be found in the client src readme, or found in the auto-complete of visual studio code.

Making requests

react-query should be used used to handle loading, error, and cacheing of data.

import React, { useEffect } from 'react';
import { useNile, Queries } from '@theniledev/react';
import { useQuery } from '@tanstack/react-query';

export default function UserTable() {
  const nile = useNile();
  const [users, setUsers] = useState();
  const { data: users = [] } = useQuery(Queries.ListUsers, () => nile.users.listUsers());
  // with multiple requests
  // const [{ data: users = [] }, { data: invites = [] }] = useQueries([
  //   { queryKey: Queries.ListUsers, queryFn: () => nile.users.listUsers({}) },
  //   { queryKey: Queries.ListInvites, queryFn: () => nile.organizations.listInvites({}) },
  // ]);

  return (
    users.map((user) => {
      return <div id={user.id}>{`Email: ${user.email}`</div>;
    })
  );
}

UI customization

For theming and display, A combination of mui joy and material ui is used. As joy approaches feature parity with material, it will be removed from this codebase. For now, there are helper functions in the theme to support both, with the theming function preferring mui joy settings and colors over material.

For details on theming, see their theming documentation. You can pass a custom theme object to the NileProvider and it will merge it with the combined material and joy themes in the <NileProvider />.

import { NileProvider } from '@theniledev/react';
import { extendTheme } from '@mui/joy/styles';
const customTheme = extendTheme({
  colorSchemes: {
    light: {
      palette: {
        primary: {
          solidBg: '#0078D4',
          solidHoverBg: '#106EBE',
          solidActiveBg: '#005A9E',
          solidDisabledBg: '#F3F2F1',
          solidDisabledColor: '#A19F9D',
        },
      },
    },
  },
});

function App() {
  return (
    <NileProvider theme={customTheme}>
      <div>Welcome to my great app</div>
    </NileProvider>
  );
}

Available components

EntityForm

InstanceList

LoginForm

Metrics

OrganizationForm

SignUpForm