OGE logoOGE

Vite, Angular CLI and Nx

OGE packages are plain ESM with typed exports maps and sideEffects declared, so every standard toolchain bundles and tree-shakes them with no plugin. The differences between setups are where the stylesheet goes and whether ng add can do it for you.

vite ng add nx

Vite (React)

npm create vite@latest orders -- --template react-ts
cd orders
npm install @oge-ui/react-grid @oge-ui/react-buttons
// src/main.tsx — the stylesheets once, at the entry
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import '@oge-ui/react-grid/styles.css';
import '@oge-ui/react-buttons/styles.css';
import '@oge-ui/core/themes/dark.css'; // optional theme
import { App } from './App';

createRoot(document.getElementById('root')!).render(
  <StrictMode>
    <App />
  </StrictMode>,
);
'use client';

import { OgeGrid } from '@oge-ui/react-grid';

const employees = [
  { id: 1, name: 'Ada Lovelace', title: 'Engineer' },
  { id: 2, name: 'Grace Hopper', title: 'Rear Admiral' },
];

// the 'use client' line is for React Server Component frameworks; Vite ignores it
const columns = [
  { field: 'id', caption: 'Id', width: 70, dataType: 'number' as const },
  { field: 'name', caption: 'Name' },
  { field: 'title', caption: 'Title' },
];

export function App() {
  return (
    <OgeGrid data={employees} keyField="id" columns={columns} locale="en-US" />
  );
}

React 18 and 19 are both supported (a peer dependency, so the packages use your app's copy). Export helpers are separate entry points and pull exceljs / jspdf into a lazy chunk only when you import them.

Angular CLI

ng new orders --style=css
cd orders
ng add @oge-ui/grid --theme=dark   # installs, registers the theme, writes AGENTS.md
  • Component styles travel with the components — there is no global stylesheet to add for the default light theme.
  • --theme=dark|high-contrast|tailwind|bootstrap puts node_modules/@oge-ui/core/themes/<theme>.cssfirst in the project's styles, so your own stylesheet still wins. Without ng add, import it yourself:
/* src/styles.css — the manual equivalent of --theme (an Nx repo, a library) */
@import '@oge-ui/core/themes/dark.css';
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { OgeGrid, OgeColumn } from '@oge-ui/grid';

@Component({
  selector: 'demo-root',
  imports: [OgeGrid, OgeColumn],
  changeDetection: ChangeDetectionStrategy.OnPush,
  template: `
    <oge-grid [data]="employees" keyField="id" [filterRow]="true">
      <oge-column field="firstName" caption="First name" />
      <oge-column field="department" caption="Department" />
      <oge-column field="salary" caption="Salary" dataType="number" />
    </oge-grid>
  `,
})
export class Demo {
  readonly employees = [
    { id: 1, firstName: 'Ali', lastName: 'Yılmaz', department: 'Engineering', city: 'İstanbul', salary: 8400, hireDate: '2019-03-11' },
    { id: 2, firstName: 'AyĹźe', lastName: 'Kaya', department: 'Sales', city: 'Ankara', salary: 7200, hireDate: '2020-07-02' },
    { id: 3, firstName: 'Mehmet', lastName: 'Demir', department: 'Engineering', city: 'İzmir', salary: 9100, hireDate: '2018-01-23' },
    { id: 4, firstName: 'Zeynep', lastName: 'Şahin', department: 'Finance', city: 'İstanbul', salary: 6800, hireDate: '2021-11-15' },
    { id: 5, firstName: 'Emre', lastName: 'Çelik', department: 'Support', city: 'Bursa', salary: 5400, hireDate: '2022-05-09' },
  ];
}

Nx workspaces

Nothing Nx-specific is needed: install at the workspace root and import from any app or library. Two differences from a CLI project:

  • ng add edits angular.json, which an Nx workspace does not have. It never fails — it prints the manual step — but the theme and the AGENTS.md block are then yours to add. Put the theme in the app's project.json styles (first) or @import it from the app's stylesheet.
  • @nx/enforce-module-boundaries only constrains your own projects; the @oge-ui/* imports are npm packages and need no tags. Keep every @oge-ui/* package on one version (Nx's single-version policy does this for you).
# OGE packages are ordinary npm dependencies of the workspace
npm install @oge-ui/grid @oge-ui/inputs        # Angular apps
npm install @oge-ui/react-grid                 # React apps

# no ng add step: an Nx workspace has no angular.json for the schematic to edit
# (it would only warn: "no angular.json found — Add @import … instead")
// apps/orders/project.json (excerpt) — a theme in the build styles, first
{
  "targets": {
    "build": {
      "options": {
        "styles": [
          "node_modules/@oge-ui/core/themes/dark.css",
          "apps/orders/src/styles.css"
        ]
      }
    }
  }
}

What every setup shares

Setup facts common to every toolchain
TopicAngularReact
Peer range @angular/core >=22.0.0 <24.0.0react ^18.0.0 || ^19.0.0
Styles Bundled with each component @oge-ui/react-<family>/styles.css (or @oge-ui/react/styles.css )
Themes @oge-ui/core/themes/{dark,high-contrast,tailwind,bootstrap}.css The same files
sideEffectsfalse ( ['*.css'] in @oge-ui/core and @oge-ui/grid , which ship theme files) ['*.css'] — the stylesheet import is kept, the JS tree-shakes
One import path for everything oge-ui (MIT families; still tree-shakeable) @oge-ui/react (MIT families)
Per-component entries @oge-ui/inputs/select-box , @oge-ui/layout/splitter , @oge-ui/buttons/fab , … Export helpers only ( @oge-ui/react-grid/export-excel , …)
Optional peers exceljs (export-excel), jspdf + jspdf-autotable (grid export-pdf) The same

Server rendering is covered in Angular SSR, bundle numbers per entry point on Bundle size.