> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reyapp.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Components

> Explore Rey's library of pre-built UI components — buttons, text fields, lists, and nav bars — and learn how to configure and bind them to data.

Components are the pre-built UI elements that make up every screen in your app. Instead of writing code to render a button or a data list, you pick the component you need from the palette, drop it onto the canvas, and configure it in its property toolbar. Every visual element in Rey — from a simple text label to a scrollable collection of cards — is a component.

## Component categories

The component palette (opened via the **+ button** in the bottom-right of the canvas) organizes every component into six top-level categories:

<AccordionGroup>
  <Accordion title="Screen">
    Add a new screen to your app. Choose a blank **Screen**, or start from a pre-built **Sign-in**, **Settings**, or **Player** screen.
  </Accordion>

  <Accordion title="Layout">
    Structural components that hold other elements: **Container**, **List**, **Carousel**, **Form**, and **AI chat**. Lists, Carousels, and Forms can each be bound to a data table so they repeat their template per entry.
  </Accordion>

  <Accordion title="Text">
    Display copy on the canvas. Pick a plain **Text** element for headings, paragraphs, and labels, or a **Rich text** block when you need in-app formatting controls (bold, links, lists, headings).
  </Accordion>

  <Accordion title="Button">
    The primary trigger for logic. Add a **Button** and attach actions to it via the **Logic** tab in the property toolbar. Buttons pick up the Primary / Secondary / Tertiary colors defined in the [Design](/building/design) panel.
  </Accordion>

  <Accordion title="Image">
    Add an **Image** from an upload, a URL, or a data field. Bind an image field on a table entry to render dynamic images inside a List item.
  </Accordion>

  <Accordion title="More">
    Advanced elements that don't fit the other categories: **Custom** components (bring your own snippet) and **Chart** visualizations (bar, line, and pie backed by a data source).
  </Accordion>
</AccordionGroup>

## Adding a component to the canvas

Every component is added from the **component palette** — a floating bar that lives at the bottom of the editor.

<Steps>
  <Step title="Tap the + button">
    In an empty area of the canvas, tap the **+** button in the bottom-right corner to open the palette.

    <Frame>
      <img src="https://mintcdn.com/rey-62fd4809/tV33NHzNGgAd5_h5/images/adding-components/plus-button.png?fit=max&auto=format&n=tV33NHzNGgAd5_h5&q=85&s=cbc4d660fee24f590f144479d8a9d4dc" alt="The + button in the bottom-right corner of the Rey editor canvas" width="3324" height="1636" data-path="images/adding-components/plus-button.png" />
    </Frame>
  </Step>

  <Step title="Pick a category">
    The palette shows the top-level categories: **Screen**, **Layout**, **Text**, **Button**, **Image**, and **More**. Tap any category to open its submenu of specific elements.
  </Step>

  <Step title="Choose an element from the submenu">
    Each category expands into a submenu with the elements available in that group. Tap the element you want to drop it onto the canvas.

    <Tabs>
      <Tab title="Screen">
        Add a new screen to your app: a blank **Screen**, a pre-built **Sign-in** screen, a **Settings** screen, or a **Player** screen.

        <Frame>
          <img src="https://mintcdn.com/rey-62fd4809/tV33NHzNGgAd5_h5/images/adding-components/screen-submenu.png?fit=max&auto=format&n=tV33NHzNGgAd5_h5&q=85&s=a9a4f203b419c711d34be0c2f8145e34" alt="Screen submenu showing Screen, Sign-in, Settings, and Player options" width="3594" height="1656" data-path="images/adding-components/screen-submenu.png" />
        </Frame>
      </Tab>

      <Tab title="Layout">
        Structural components that hold other elements: **Container**, **List**, **Carousel**, **Form**, and **AI chat**.

        <Frame>
          <img src="https://mintcdn.com/rey-62fd4809/tV33NHzNGgAd5_h5/images/adding-components/layout-submenu.png?fit=max&auto=format&n=tV33NHzNGgAd5_h5&q=85&s=d943931a89ef5c7029b9bddf280cae95" alt="Layout submenu showing Container, List, Carousel, Form, and AI chat options" width="2938" height="1662" data-path="images/adding-components/layout-submenu.png" />
        </Frame>
      </Tab>

      <Tab title="Text">
        Choose between a simple **Text** element or a **Rich text** block with formatting controls.

        <Frame>
          <img src="https://mintcdn.com/rey-62fd4809/tV33NHzNGgAd5_h5/images/adding-components/text-submenu.png?fit=max&auto=format&n=tV33NHzNGgAd5_h5&q=85&s=1310ecd8298cc7af7b4a89450a9a5f80" alt="Text submenu showing Text and Rich text options" width="1294" height="738" data-path="images/adding-components/text-submenu.png" />
        </Frame>
      </Tab>

      <Tab title="More">
        Advanced elements that don't fit the other categories: **Custom** components and **Chart** visualizations.

        <Frame>
          <img src="https://mintcdn.com/rey-62fd4809/tV33NHzNGgAd5_h5/images/adding-components/more-submenu.png?fit=max&auto=format&n=tV33NHzNGgAd5_h5&q=85&s=894e6b8f4dd314e322c46a935f41be7f" alt="More submenu showing Custom and Chart options" width="566" height="446" data-path="images/adding-components/more-submenu.png" />
        </Frame>
      </Tab>
    </Tabs>
  </Step>

  <Step title="Position and resize">
    Once the element is on the canvas, drag it to reposition it or use the resize handles. Fine-tune size and alignment from the **Layout** tab of the property toolbar.
  </Step>
</Steps>

## Configuring a component

Select any component on the canvas to open its **property toolbar** — a floating bar that appears directly above the selected component. The available settings vary by component type, but every component shares the same four tabs:

<CardGroup cols={2}>
  <Card title="Settings" icon="sliders-horizontal">
    Component-specific options — the destination of a Button, the placeholder text of a form field, and so on. A List's source table is set separately via the **Data** option.
  </Card>

  <Card title="Layout" icon="layout-dashboard">
    Size, padding, margin, and alignment, plus how the component sizes itself inside its parent (fixed size, fill container, or hug content).
  </Card>

  <Card title="Logic" icon="zap">
    Attach [Logic](/building/interactions) to the component — triggers, actions, and optional rules that run in response to user events.
  </Card>

  <Card title="Styles" icon="palette">
    Colors, fonts, borders, corner radius, opacity, and shadow. Values pull from your app's palette by default — see [Design](/building/design).
  </Card>
</CardGroup>

## Binding a component to data

Static text and images are useful, but Rey becomes powerful when you connect components to live data. Binding links a component's content to a **field** on a table entry.

<Steps>
  <Step title="Connect the List to a data table">
    Click the List to select it, open the property toolbar above it, and choose **Data**. Select the table you want as the data source.
  </Step>

  <Step title="Select the element to bind">
    Tap the element inside the List you want to bind — for example, a **Text** label in the row template — and open its property toolbar.
  </Step>

  <Step title="Choose Data field">
    Choose the **Data field** option in the property toolbar.
  </Step>

  <Step title="Pick the data field">
    Select the field you want to display — for example, `Users > display_name`. The element now renders real data from that field and updates automatically when entries change.
  </Step>
</Steps>

<Tip>
  Use the **Logic** tab to gate a component's visibility with a rule — for example, only show an "Admin" badge when the current user's `role` field equals `admin`.
</Tip>

## Copying and reusing components

* **Duplicate** a component by selecting it and pressing **⌘ D**. The duplicate appears directly on top of the original — drag it into position.
* To reuse a complex arrangement of components across screens, save it as a template — see [Templates](/building/templates).
