6.0.2 • Published 5 months ago

@moser-inc/moser-labs-react v6.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

Moser Labs React npm

React components for the Moser Labs suite of applications. Build on top of PrimeReact.

Installation

npm i primereact @moser-inc/moser-labs-react

Usage

Setup

Wrap your application with the LabsProvider component to provide the app name, theme and favicon urls, and other potential configuration:

// App.tsx
import { LabsProvider } from '@moser-inc/moser-labs-react';

const FAVICONS = {
  dark: 'favicon-dark.svg',
  light: 'favicon-light.svg',
};

const THEMES = {
  dark: 'theme-dark.css',
  light: 'theme-light.css',
};

const App = () => {
  return (
    <LabsProvider appName="My App" favicons={FAVICONS} themes={THEMES}>
      {/* Your app components */}
    </LabsProvider>
  );
};

Styles

Either load all component styles in your entry point, which may include unused styles:

// main.tsx
import '@moser-inc/moser-labs-react/style.css';

Or when using UnoCSS with a bundler like Vite, configure your content sources to include labs components to load only the styles that are used:

// uno.config.ts
import { defineConfig } from 'unocss';

export default defineConfig({
  content: {
    pipeline: {
      include: [
        /(.*\/)primereact(.*)\.(c|m)?(js)(x?)$/, // primereact
        /(.*\/)@moser-inc(\/|_)moser-labs-react(.*)\.(c|m)?(js)(x?)$/, // @moser-inc/moser-labs-react
        /\.(vue|svelte|[jt]sx|mdx?|astro|elm|php|phtml|html)($|\?)/, // default
      ],
    },
  },
});
// App.tsx
import { LabsButton } from '@moser-inc/moser-labs-react';

const App = () => {
  return (
    <div>
      <LabsButton>Moser Labs</LabsButton>
    </div>
  );
};
5.1.1

5 months ago

5.1.0

5 months ago

1.16.5

11 months ago

2.0.2

7 months ago

2.0.1

10 months ago

2.0.0

10 months ago

3.0.2

5 months ago

3.0.1

5 months ago

3.0.0

5 months ago

4.0.0

5 months ago

5.0.2

5 months ago

5.0.1

5 months ago

5.0.0

5 months ago

1.17.0

11 months ago

6.0.1

5 months ago

6.0.0

5 months ago

6.0.2

5 months ago

2.1.1

5 months ago

2.1.0

5 months ago

3.1.1

5 months ago

3.1.0

5 months ago

4.1.0

5 months ago

4.1.1

5 months ago

1.16.3

1 year ago

1.16.2

1 year ago

1.16.1

1 year ago

1.16.4

1 year ago

1.15.3

2 years ago

1.15.2

2 years ago

1.15.1

2 years ago

1.15.0

2 years ago

1.14.2

2 years ago

1.14.1

2 years ago

1.13.0

2 years ago

1.12.2

2 years ago

1.12.1

2 years ago

1.12.0

2 years ago

1.11.1

2 years ago

1.11.0

2 years ago

1.10.3

2 years ago

1.10.2

2 years ago

1.10.1

2 years ago

1.10.0

2 years ago

1.9.0

2 years ago

1.8.1

2 years ago

1.8.0

2 years ago

1.7.0

2 years ago

1.6.0

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago