@burojs/react
v0.2.0
Published
Buro: React Provider, hooks, slot adapter, base UI translations, BuroRoutes
Readme
@burojs/react
React bindings for buro: context providers, the list controller, i18n, capabilities and test-id plumbing.
UI-kit agnostic — it deliberately depends on no @burojs/ui-* package, so any renderer can sit on top. Its native data runtime uses @tanstack/react-query internally.
Install
pnpm add @burojs/react @burojs/coreUsage
import { BuroProvider, useResourceList } from '@burojs/react';
function Root({ app, children }) {
return <BuroProvider app={app}>{children}</BuroProvider>;
}
function MyList() {
const list = useResourceList('company');
return (
<ul>
{list.rows.map((r) => (
<li key={r.id}>{String(r.name)}</li>
))}
</ul>
);
}Main exports
useResourceList— the data-connected list controller: rows, pagination (including the unknown-total contract), filters, search, sorting, columns, selection, saved views, routing hrefs, and the on-demand row count.ResourceListProvider/useResourceListContextexpose it to override slots, so a custom list body is testable against a stub controller with no runtime or Next mocking.useApp/useCurrentResource/useCtx— registry and context access.useAction— invoke a declared action and apply itsActionResult.useCapability/useCapabilityResolver— the deny-wins capability engine gating fields, actions and tabs.useComponent/mergeComponents/ComponentsContext— the component registry behind override slots (list.body.<resource>,list.filters.<resource>,show.banner.<resource>, …).useT/useLocale/I18nContext, plus the built-inen/rulocale bundles — render-time i18n with a live language switch (no reload).TestIdBuilder/TestIdContext— the stable test-id surface shared with@burojs/test-helpers.
License
MIT
