@altertable/data-app-react
v0.77.0
Published
React components, hooks, styles, and authoring tools for Altertable data apps.
Readme
@altertable/data-app-react
React components, hooks, styles, and authoring tools for Altertable data apps.
Installation
bun add @altertable/data-app @altertable/data-app-react react react-domReact and React DOM 19.2 or newer are required.
Usage
Mount a simple static screen into an element with id="root":
import { defineDataApp } from '@altertable/data-app';
import { injectDataAppStyles, mountDataApp } from '@altertable/data-app-react';
import { MetricWidget } from '@altertable/data-app-react/ui';
const dataApp = defineDataApp({
title: 'Activity',
description: 'A snapshot of activity.',
scope: { organization: 'demo', environment: 'production' },
queries: {},
});
function App() {
return (
<MetricWidget
label="Active projects"
value={42}
format={{ kind: 'count' }}
/>
);
}
injectDataAppStyles();
mountDataApp({ app: dataApp, component: App });Use the main entry for declared views, bound widgets, and layouts; /ui supports
setup screens, static content, and custom composition. Install styles explicitly
with injectDataAppStyles().
To host an app iframe, use @altertable/data-app-embed/react.
Documentation
See the React guide for apps with queries, filters, and bound widgets.
License
MIT. Vendored code is covered by third-party notices.
