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 🙏

© 2026 – Pkg Stats / Ryan Hefner

orma-ui

v0.0.19

Published

UI components and functions for orma, react and mobx

Readme

orma-ui

npm version License: MIT GitHub stars

React UI components and functions for Orma, an ORM and query language. This library provides a schema-aware visual query builder for constructing complex database queries with ease.

orma-ui integrates deeply with MobX for state management and Material UI for a polished, responsive interface. It allows users to build nested queries, apply filters, and manage aggregations through an intuitive visual interface alongside a real-time JSON editor.

Features

  • Schema-Aware Query Building: Automatically detects entities, fields, and relationships from your OrmaSchema.
  • Visual Clause Construction: Build complex WHERE and HAVING clauses with support for connectives ($and, $or) and operators ($eq, $gt, $in).
  • Relationship Navigation: Follow foreign key relationships to build nested and related entity queries.
  • Advanced Query Support: Includes support for GROUP BY, ORDER BY, field aliasing, and pagination ($limit, $offset).
  • Aggregate Functions: Easily apply functions like $count to your data.
  • Integrated JSON Editor: Real-time synchronization between the visual builder and a Monaco-based JSON editor.
  • Connected Entity Filtering: Advanced filtering using $where_connected for complex relational logic.

Installation

Install the package via npm:

npm install orma-ui

Peer Dependencies

Ensure you have the following peer dependencies installed in your project:

  • React: >=17.0.0
  • MobX: >=6.0.0
  • MUI: @mui/material >=5.0.0
  • Emotion: @emotion/react >=11.0.0, @emotion/styled >=11.0.0
  • Orma: >=1.0.267

Quick Start

The primary component is the QueryBuilder. It requires an observable query object and your database schema.

import React from 'react';
import { makeAutoObservable } from 'mobx';
import { observer } from 'mobx-react-lite';
import { QueryBuilder } from 'orma-ui';

// Define your schema and an observable query object
const schema = { /* your OrmaSchema */ };
const state = makeAutoObservable({
  query: {}
});

const App = observer(() => {
  return (
    <div style={{ height: '600px' }}>
      <QueryBuilder 
        query={state.query} 
        orma_schema={schema} 
      />
    </div>
  );
});

Components

QueryBuilder

The QueryBuilder is a comprehensive interface for designing Orma queries. It provides a visual tree for selecting fields and entities, a dedicated section for clause management, and a side-by-side JSON editor for power users.

It handles deep nesting, reverse nesting via foreign keys, and subqueries out of the box. Because the query object is observable, any changes made in the visual UI or the JSON editor are reflected across your application immediately.

Development

To run the component stories locally and explore different query configurations, use the Ladle dev server:

# Install dependencies
npm install

# Start the dev server
npm run dev

The stories cover various use cases including basic field selection, deep nesting, complex filtering, and aggregate functions.

License

This project is licensed under the MIT License. See the LICENSE file for details.