> ## Documentation Index
> Fetch the complete documentation index at: https://rive-new-listeners-vid.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Text

> Create and format text, control sizing and overflow, and convert text to shapes.

export const YouTube = ({id, timestamp}) => {
  const videoSrc = timestamp ? `https://www.youtube.com/embed/${id}?start=${timestamp}` : `https://www.youtube.com/embed/${id}`;
  return <iframe width="100%" height="400" src={videoSrc} title="YouTube video player" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerPolicy="strict-origin-when-cross-origin" allowFullScreen />;
};

<YouTube id="nykDEo6XqXY" />

## Creating Text

Press `T` or select the **Text Tool** from the toolbar.

* **Click** anywhere on the artboard to create text that automatically sizes to its content.
* **Click and drag** to create a text box with a defined width.

Double-click text to edit its content.

## Text Properties

Select text to view its properties in the Inspector. In addition to standard properties such as position, rotation, and origin, you can control how text sizes, wraps, aligns, and handles overflow.

### Align Origin to Baseline

Enable **Align Origin to Baseline** to align the text's origin to its baseline.

<img src="https://mintcdn.com/rive-new-listeners-vid/KavAvXWbKHtl0y4a/images/editor/design/text/align-origin-to-baseline.gif?s=eb3b9eadbb63d856bb99eb5ba3c579db" alt="Toggle Align Origin to Baseline" width="640" height="143" data-path="images/editor/design/text/align-origin-to-baseline.gif" />

### Sizing

Use the sizing options to control how the bounds of the text respond to its content.

* **Auto Width**: The width and height adjust to fit the text.
* **Auto Height**: The width remains fixed while the height adjusts to fit the text.
* **Fixed Size**: The width and height remain fixed.

<img src="https://mintcdn.com/rive-new-listeners-vid/KavAvXWbKHtl0y4a/images/editor/design/text/text-sizing-types.png?fit=max&auto=format&n=KavAvXWbKHtl0y4a&q=85&s=e8d7c6e0f237e4d181b85d5d05ee7a33" alt="Three text elements with each of the different size options" width="1114" height="514" data-path="images/editor/design/text/text-sizing-types.png" />

### Overflow

Overflow controls what happens when the sizing is fixed and the text exceeds its available bounds.

* **Visible**: Displays text beyond the bounds.
* **Hidden**: Hides lines that don't fit within the bounds. Partial lines aren't displayed.
* **Clipped**: Clips text at the bounds, including partial lines.
* **Ellipsis**: Truncates overflowing text with an ellipsis.
* **Fit**: Adjusts the text to fit within the available bounds.
* **Fit Font Size**: Adjusts the font size to fit the text within the available bounds.

<img src="https://mintcdn.com/rive-new-listeners-vid/KavAvXWbKHtl0y4a/images/editor/design/text/overflow-options.png?fit=max&auto=format&n=KavAvXWbKHtl0y4a&q=85&s=d507dfe7204a8251ee45c1b0ba6f5d69" alt="Text elements showing the various overflow options" width="856" height="990" data-path="images/editor/design/text/overflow-options.png" />

### Wrapping

Use **Wrap** to allow text to move to a new line when it reaches the available width. Use **No Wrap** to keep text on a single line.

See how disabling wrap works differently with the various overflow options:

<img src="https://mintcdn.com/rive-new-listeners-vid/KavAvXWbKHtl0y4a/images/editor/design/text/wrap-options.gif?s=c8759fb6d69da53f9ee44e47e8ea2439" alt="Toggle wrap with text elements with the various overflow options" width="640" height="454" data-path="images/editor/design/text/wrap-options.gif" />

### Alignment

Use horizontal and vertical alignment to control how text is positioned within its available bounds.

<Note>
  The available alignment options depend on the sizing mode:

  * **Auto Width**: Alignment has no effect because the text bounds automatically fit the content.
  * **Auto Height**: Vertical alignment has no effect because the height automatically fits the content.

      <img src="https://mintcdn.com/rive-new-listeners-vid/KavAvXWbKHtl0y4a/images/editor/design/text/text-alignment.png?fit=max&auto=format&n=KavAvXWbKHtl0y4a&q=85&s=784d4d26a0e2bed809e43dfd607f1f62" alt="Text elements showing horizontal and vertical alignment options" width="1494" height="596" data-path="images/editor/design/text/text-alignment.png" />
</Note>

### Paragraph Spacing

Use **Paragraph Spacing** to control the amount of space between paragraphs.

### Trim

Use **Trim** to adjust the vertical bounds of text.

* **None**
* **Cap**
* **Ex**

<img src="https://mintcdn.com/rive-new-listeners-vid/KavAvXWbKHtl0y4a/images/editor/design/text/trim-options.png?fit=max&auto=format&n=KavAvXWbKHtl0y4a&q=85&s=eeea53140d4da58d03910b8ee05b4f58" alt="Text Trim Options" width="792" height="600" data-path="images/editor/design/text/trim-options.png" />

### Bounds

Choose how the text bounds are calculated.

* **None**
* **Alphabetic**
* **Text**

Text bounds determine how the bounds of the text are calculated relative to the font's metrics.

<img src="https://mintcdn.com/rive-new-listeners-vid/KavAvXWbKHtl0y4a/images/editor/design/text/text-bounds-options.png?fit=max&auto=format&n=KavAvXWbKHtl0y4a&q=85&s=3199c487ae56eb3bbe3099c15c771448" alt="Text with Bounds option set to none, text, and alphabetic" width="1006" height="420" data-path="images/editor/design/text/text-bounds-options.png" />

## Flatten to Shape

Use **Flatten to Shape** to convert text into vector shapes. Once flattened, the resulting shapes can be edited like other vector geometry but can no longer be edited as text.

<Note>
  Flattening text can create a significant amount of geometry. If you're flattening text to reduce the size of an embedded font, consider keeping the text as text and including only the [used glyphs](/editor/text/fonts#export-options) instead.
</Note>
