@k8ordo/ui

React components, buttons and dialogs included, that you can place in a Server Component

bash
npm install @k8ordo/ui @k8ordo/i18n
main.tsx
import '@k8ordo/ui/styles.css';
subscribe-form.tsx
<FormControl
  label="Email"
  renderInput={(props) => (
    <TextField {...props} type="email" />
  )}
/>
<Button type="submit" variant="solid">
  Subscribe
</Button>

Menus and tooltips in the top layer

Menus and tooltips open in the top layer through the Popover API, and CSS Anchor Positioning places them. There is no z-index to tune.

Only browser features at Baseline are used. There is no polyfill and no branch for old browsers.

Playground

Menu and tooltip demo

Both are @k8ordo/ui components, used unchanged.

Last action
—

Try it

  1. Press “Actions” to open the menu. Move through it with the arrow keys, then close it with Esc.
  2. Hover the envelope button, or Tab to it. Its name shows in a tooltip.

Same components in vertical writing

Inside an element with writing-v, the components render vertically on their own. There are no props to pass.

A page that sets Japanese vertically needs no separate buttons or cards.

Playground

Vertical writing demo

The switch toggles the writing-mode of the card below.

Notice

A vertical page

The same components follow the direction of the text.

Docs for agents, a catalog for generative UI

The design guide and the references ship inside the npm package. An agent reads the installed version from node_modules/@k8ordo/ui/docs/.

To let an LLM compose a screen, use the json-render or OpenUI catalog. The catalog is checked against the components’ prop types, so it cannot drift from the implementation.

gen-ui.tsx
const systemPrompt = catalog.prompt({
  customRules: [...uiRules],
});

const result = validateGeneratedSpec(JSON.parse(llmOutput));
if (result.ok) return <JsonRenderUI spec={result.spec} />;