> For the complete documentation index, see [llms.txt](https://docs.rierino.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rierino.com/sdk-core-ui/guides/hosted-editors.md). Agents can also search and read this documentation through its [MCP server](https://docs.rierino.com/~gitbook/mcp).

# Usage in hosted editors

Use Core UI in the custom lists, editors, pages and widgets you write inside Rierino.

Rierino lets you write React code in the admin UI and render it as part of a screen, with no build or deployment. These are called **hosted** (or custom code) components. Core UI is already loaded in that environment, so there is nothing to install. Import it, and your component looks and behaves like the rest of Rierino.

{% hint style="info" %}
This page covers using Core UI in hosted code. For creating hosted widgets, where they plug in and which props they receive, see [Hosted Widgets](https://docs.rierino.com/design/user-interface/uis/widgets/hosted-widgets) in the Rierino documentation.
{% endhint %}

## Importing Core UI

{% hint style="danger" %}
**Named imports don't compile**

Hosted code receives `@rierino-open/core-ui` as a **single default export**. `import { Button } from "@rierino-open/core-ui"` is a compile error. Default-import the module and destructure it.
{% endhint %}

```jsx
// ❌ Compile error
import { Button, Grid } from "@rierino-open/core-ui";

// ✅ Default import, then destructure
import CoreUI from "@rierino-open/core-ui";
const { Button, Grid } = CoreUI;
```

A complete hosted component using Core UI:

{% code title="Greeting.jsx" %}

```jsx
import React from "react";
import CoreUI from "@rierino-open/core-ui";
const { Button, Grid } = CoreUI;

export default function Greeting(props) {
  return (
    <Grid flex gap={2}>
      <Grid.Item>Hello {props.data?.name}</Grid.Item>
      <Grid.Item>
        <Button intent="g-button" onPress={() => alert("Hi!")}>
          Say hi
        </Button>
      </Grid.Item>
    </Grid>
  );
}
```

{% endcode %}

## What's available

Every export of the package is on the default import: `AutocompleteBase`, `AutocompleteInput`, `Button`, `Calendar`, `Checkbox`, `CheckboxGroup`, `ClickAwayListener`, `Grid`, `Input`, `Menu`, `Modal`, `Popover`, `Radio`, `RadioGroup`, `Rating`, `Slider`, `Switch`, `Tab`, `TabList`, `TabPanel`, `Tabs`, `TextField`, `TreeView` and the `DV` namespace.

Hosted code always gets the Core UI version bundled with your Rierino release, along with its stylesheet. You don't import `style.css` yourself, and you can't choose another version.

## Styling

Core UI components in hosted code follow the active Rierino theme automatically. To change their accent and border colours, set the theme variables (`--primary`, `--border-color` and the rest) in Rierino's [Styles](https://docs.rierino.com/design/user-interface/styles) feature rather than in your component.

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Color themes</strong></td><td>The theme variables Core UI reads, how to scope them, and the Rierino palette.</td><td><a href="https://docs.rierino.com/sdk-core-ui/foundations/colors.md">Color themes</a></td></tr></tbody></table>

To restyle a single component, or style its selected, focused or disabled states, see [Styling components](https://docs.rierino.com/sdk-core-ui/foundations/styling.md). In hosted code, write your own CSS classes rather than Tailwind utilities, because only the Tailwind classes Core UI already uses are available.

For your own markup around the components:

* **Prefix class names with `Rie-` plus your component name**, for example `Rie-Greeting-root`, so they don't collide with the platform's styles or with other hosted components on the same screen.
* **Use palette variables instead of hard-coded colours**, for example `var(--color-athens-gray)`, so your markup follows theme changes. The full list is on [Color themes](https://docs.rierino.com/sdk-core-ui/foundations/colors.md#palette).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rierino.com/sdk-core-ui/guides/hosted-editors.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
