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

@cortexui/components

v1.1.2

Published

> [!WARNING] > **CortexUI has been renamed to DOMglyph.** > > `@cortexui/components` is **no longer maintained**. All future development, bug fixes, and releases happen under the new package: > > **➜ [`@domglyph/components`](https://www.npmjs.com/package/

Downloads

456

Readme

[!WARNING] CortexUI has been renamed to DOMglyph.

@cortexui/components is no longer maintained. All future development, bug fixes, and releases happen under the new package:

@domglyph/components — starting at v2.0.0

Please migrate at your earliest convenience:

npm uninstall @cortexui/components
npm install @domglyph/components

Then update all imports from '@cortexui/components' to '@domglyph/components'.


@cortexui/components (deprecated)

npm version License: MIT deprecated

React components with built-in AI contracts — now continued as @domglyph/components.


Overview

@cortexui/components is the primary package for building CortexUI interfaces. Every component in this package automatically outputs the correct data-ai-* attributes — no manual annotation required.

Pass in semantic props (action, state, entityType, etc.) and the component handles the contract. The result is an interface that is immediately inspectable by AI agents via window.__CORTEX_UI__.


Installation

npm install @cortexui/components

Peer dependencies:

npm install react@^18 react-dom@^18

Components

ActionButton

A button that triggers an action. Renders with data-ai-role="action", data-ai-id, data-ai-action, and data-ai-state automatically.

import { ActionButton } from '@cortexui/components';

// Idle state — ready for interaction
<ActionButton action="save-profile" state="idle" label="Save Profile" />
// <button data-ai-role="action" data-ai-id="save-profile"
//         data-ai-action="save-profile" data-ai-state="idle">Save Profile</button>

// Loading state — async operation in progress
<ActionButton action="save-profile" state="loading" label="Save Profile" />
// <button data-ai-role="action" data-ai-id="save-profile"
//         data-ai-action="save-profile" data-ai-state="loading" disabled>Save Profile</button>

// Success state — operation completed
<ActionButton action="save-profile" state="success" label="Save Profile" />
// <button data-ai-role="action" data-ai-id="save-profile"
//         data-ai-action="save-profile" data-ai-state="success">Save Profile</button>

// Error state — operation failed
<ActionButton action="save-profile" state="error" label="Save Profile" />
// <button data-ai-role="action" data-ai-id="save-profile"
//         data-ai-action="save-profile" data-ai-state="error">Save Profile</button>

// Disabled
<ActionButton action="save-profile" state="disabled" label="Save Profile" />
// <button data-ai-role="action" data-ai-id="save-profile"
//         data-ai-action="save-profile" data-ai-state="disabled" disabled>Save Profile</button>

Full props:

interface ActionButtonProps {
  readonly action: string;       // verb-noun action name, becomes data-ai-action and data-ai-id
  readonly state: AIState;       // idle | loading | success | error | disabled
  readonly label: string;        // visible button text
  readonly section?: string;     // data-ai-section (optional)
  readonly onClick?: () => void;
}

FormField

A labelled input field. Renders with data-ai-role="field", data-ai-id, data-ai-field-type, and data-ai-required automatically.

import { FormField } from '@cortexui/components';

<FormField
  id="user-email"
  fieldType="email"
  label="Email address"
  required
  state="idle"
/>
// <div data-ai-role="form" data-ai-id="user-email-field">
//   <label>Email address</label>
//   <input data-ai-role="field" data-ai-id="user-email"
//          data-ai-field-type="email" data-ai-required="true"
//          data-ai-state="idle" type="email" />
// </div>

// Error state with message
<FormField
  id="user-email"
  fieldType="email"
  label="Email address"
  required
  state="error"
  errorMessage="Please enter a valid email"
/>

DataTable

A table of entity rows. Renders with data-ai-role="table", data-ai-entity, and per-row data-ai-entity-id attributes.

import { DataTable } from '@cortexui/components';

<DataTable
  entityType="order"
  columns={[
    { key: 'id', label: 'Order ID' },
    { key: 'status', label: 'Status' },
    { key: 'total', label: 'Total' },
  ]}
  rows={orders}
  getRowId={(row) => row.id}
/>
// <table data-ai-role="table" data-ai-entity="order">
//   <tbody>
//     <tr data-ai-entity="order" data-ai-entity-id="ord-001">...</tr>
//     <tr data-ai-entity="order" data-ai-entity-id="ord-002">...</tr>
//   </tbody>
// </table>

StatusBanner

A read-only banner communicating system or operation status. Renders with data-ai-role="status" and data-ai-state.

import { StatusBanner } from '@cortexui/components';

// Informational
<StatusBanner type="info" message="Your session expires in 5 minutes." />
// <div data-ai-role="status" data-ai-state="idle" data-ai-id="status-banner">...</div>

// Success
<StatusBanner type="success" message="Profile saved successfully." />
// <div data-ai-role="status" data-ai-state="success" data-ai-id="status-banner">...</div>

// Warning
<StatusBanner type="warning" message="Unsaved changes will be lost." />

// Error
<StatusBanner type="error" message="Failed to save. Please try again." />
// <div data-ai-role="status" data-ai-state="error" data-ai-id="status-banner">...</div>

ConfirmDialog

A modal dialog requesting confirmation before a destructive or significant action. Renders with data-ai-role="modal" and child action buttons with named data-ai-action attributes.

import { ConfirmDialog } from '@cortexui/components';

<ConfirmDialog
  id="delete-account-dialog"
  title="Delete account"
  description="This action cannot be undone. All your data will be permanently deleted."
  confirmAction="confirm-delete-account"
  cancelAction="cancel-delete-account"
  confirmLabel="Delete account"
  cancelLabel="Cancel"
  state="idle"
  onConfirm={handleDelete}
  onCancel={handleCancel}
/>
// <div data-ai-role="modal" data-ai-id="delete-account-dialog" data-ai-state="idle">
//   ...
//   <button data-ai-role="action" data-ai-action="confirm-delete-account"
//           data-ai-id="confirm-delete-account" data-ai-state="idle">Delete account</button>
//   <button data-ai-role="action" data-ai-action="cancel-delete-account"
//           data-ai-id="cancel-delete-account" data-ai-state="idle">Cancel</button>
// </div>

AI Contract

Every component in this package outputs the correct data-ai-* attributes automatically. You pass semantic props; the component handles the annotation.

When ActionButton with action="save-profile" is rendered, an AI agent can call:

const actions = window.__CORTEX_UI__.getAvailableActions();
// [
//   {
//     id: "save-profile",
//     action: "save-profile",
//     state: "idle",
//     section: null
//   }
// ]

The agent can then act deterministically:

document.querySelector('[data-ai-id="save-profile"]').click();

No selector guessing. No text parsing. No fragile heuristics.


Part of CortexUI

@cortexui/components is part of the CortexUI design system.