it-data-nexus-ui-library
v4.0.1
Published
Nexus core components
Keywords
Readme
it-data-nexus-ui-library
The shared, Sage-themed component library for every Nexus frontend, built on MUI.
Build UI from these components, not from @mui/material. Import icons from
@mui/icons-material. If a component is missing, raise it for this library first.
Install
npm i it-data-nexus-ui-librarynpm 7+ installs the peer dependencies for you (react, @mui/material,
@mui/x-data-grid, @mui/x-date-pickers, date-fns, react-day-picker,
react-markdown, remark-gfm, @xyflow/react and the rest). Declare them in
your app's package.json as well, so their versions are yours to control. The
@rjsf/* peers are only needed for SchemaForm, below.
Wrap the app in ThemeModeProvider. It sets up the Nexus theme and remembers
the user's light/dark choice; read or change it with useThemeMode().
import { ThemeModeProvider } from "it-data-nexus-ui-library";
<ThemeModeProvider defaultMode="light">
<App />
</ThemeModeProvider>Favicon
Components bundle their own fonts and images. Only the favicon needs the files
copied into your app, because index.html links to it. Add a postinstall
script (cpx2 is the package the template uses):
"postinstall": "cpx \"node_modules/it-data-nexus-ui-library/dist/assets/**\" public/assets/it-data-nexus-ui-library/"<link rel="icon" type="image/svg+xml" href="/assets/it-data-nexus-ui-library/images/nexus-logo-favicon.svg" />
<link rel="icon" href="/assets/it-data-nexus-ui-library/images/favicon.ico" />If you can't use index.html, <FaviconLinks /> renders the same links at
runtime.
Separate entries
SchemaForm wraps @rjsf/mui, so it is not in the main entry. Install
@rjsf/mui @rjsf/core @rjsf/utils @rjsf/validator-ajv8 and import from the
subpath:
import { SchemaForm } from "it-data-nexus-ui-library/schema-form";NexusFlow (node graphs) needs its stylesheet imported once:
import "it-data-nexus-ui-library/react-flow.css";
import { NexusFlow, FlowControls } from "it-data-nexus-ui-library";The canvas fills its parent, so give the parent a height. There is no auto-layout: pass positioned nodes.
Development
npm run storybook # component stories on :6006
npm run lint
npm run test:unit
npm run buildEvery component needs a story. See CLAUDE.md for the full rules. Publishing
(npm version, npm publish) is done by the maintainer.
