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 🙏

© 2024 – Pkg Stats / Ryan Hefner

onyxia-ui

v5.1.11

Published

The Onyxia UI toolkit

Downloads

625

Readme

This project is a React UI toolkit that implement a design system created for Onyxia by Marc Hufschmitt.

This project provide some custom components but you can also use any MUI component they will be automatically styled to fit the design system.

  • Optimized for typescript, theme customization without module augmentation.
  • Built in support for the dark mode.
  • If you want to diverge from the Onyxia Design system, the theme is customizable, you can for example change the fonts and the colors.
  • Provide splash screen that hide the screen when needed.
  • Icons are downloaded at runtime. The full catalog of mui icons is is available at runtime. (No hard import required)

Disclaimer: onyxia-ui is specifically designed to build SPA and is not SSR compatible.

A note about the integration of Onyxia and Onyxia-UI can be found here.

Showcase

datalab.sspcloud.fr

datalab.sspcloud.fr with "France" palette

datalab.sspcloud.fr with "Ultraviolet" palette

www.sspcloud.fr

Quick start

yarn add onyxia-ui @mui/material @emotion/react @emotion/styled

Icons

Onyxia-ui enables you to use icons from the Material Design Library.
Or to provide your own icon as SVG urls.

Using Material Icons: With hard import

If you know what icon you'll need ahead of time, implement this approach:

yarn add @mui/icons-material

src/theme.ts

const { ThemeProvider } = createThemeProvider({
    // ...
    publicUrl: undefined,
});

Now if you want to use AccessAlarms

import AccessAlarmIcon from "@mui/icons-material/AccessAlarm";

<Icon icon={AccessAlarmIcon} />;

Using Material Icons: With lazy loading

If you don't know ahead of time what icon you will need. This is the case if your app renders user generated content that might include icons then you can opt for downloading the icons dynamically.
Be aware that this involves including a 35MB directory of icons in your public/ directory which will end up impacting your docker image size.

"scripts": {
    "prepare": "copy-material-icons-to-public"
}

OPTIONAL: Use cache in your Workflow to speed up your CI pipeline

    - uses: bahmutov/npm-install@v1
      env:
        XDG_CACHE_HOME: "/home/runner/.cache/yarn"

This will enable you to do this:

import { Icon } from "onyxia-ui/Icon";

// https://mui.com/material-ui/material-icons/?selected=AccessAlarms
<Icon icon="AccessAlarms" />;

Or, if you want type safety:

import { Icon } from "onyxia-ui/Icon";
import { id } from "tsafe/id";
import type { MuiIconComponentName } from "onyxia-ui/MuiIconComponentName";

// https://mui.com/material-ui/material-icons/?selected=AccessAlarms
<Icon icon={id<MuiIconComponentName>("AccessAlarms")} />;

Using custom SVGs as icons

import myIconSvgUrl from "./assets/my-icon.svg";

<Icon icon={myIconSvgUrl} />
<Icon icon="https://example.com/foo/my-icon.svg" />

Documentation

The documentation is under the form of a very simple demo project.
The actual theme configuration happens here.
If you want to experiment with it you can run the demo app with:

NOTE for Storybook users: As of writing this lines storybook still uses by default emotion 10.
mui and TSS runs emotion 11 so there is some changes to be made to your .storybook/main.js to make it uses emotion 11.

Launch dev environment

git clone https://github.com/garronej/onyxia-ui
cd onyxia-ui
yarn
yarn build
yarn start