---
title: "Text"
description: "This article explains what the text field is and how to configure it."
meta_title: "Text"
category: "fields"
audience: developers
lastUpdated: "2026-04-23T01:17:46.000Z"
---

The text field allows content writers to provide plain text.

Text field values can be used like a string in JavaScript.

**Next.js example:**

```tsx
<p>My name: {slice.primary.name}</p>
```

**Nuxt example:**

```vue-html
<p>My name: {{ slice.primary.name }}</p>
```

**SvelteKit example:**

```svelte
<p>My name: {slice.primary.name}</p>
```

> The text field and [rich text field](https://prismic.io/docs/fields/rich-text.md) look similar. Use the text field for simple text that does not require formatting. Use the rich text field for text that requires formatting.

# Add a text field to a content model

Text fields are added using the [Type Builder](https://prismic.io/docs/type-builder.md), a tool for building by hand, or the [Prismic CLI](https://prismic.io/docs/cli.md), a tool for AI agents.

* **Type Builder:**

  > **Important**
  >
  > Type Builder is rolling out to new users. If you do not have access, use **Slice Machine**.

  1. **Watch for changes**

     In your local website project, start the Prismic CLI's `sync` command. The CLI will watch for changes in the Type Builder and pull them into your project.

     ```sh
     npx prismic sync --watch
     ```

     > **Tip**: You can pull Type Builder changes at any time using `npx prismic
     >   sync`.

  2. **Add a text field**

     In the Type Builder, navigate to the slice, page type, or custom type you want to modify. Add a **text** field and provide the following:

     * **Label**: The label shown to content writers in the [Page Builder](https://prismic.io/docs/guides/page-builder.md). Use an easily understandable name.
     * **API ID**: The property name in the Content API. Use a short, snake-cased name.

     You can now close the Prismic CLI `sync` command or add your next field.

* **Prismic CLI:**

  > Your AI agent can perform these steps for you. See [Prismic with AI](https://prismic.io/docs/ai.md) for details.

  1. **Add a text field**

     Use the `prismic field add text` command to add a text field to a slice.

     ```sh
     npx prismic field add text title --to-slice MySlice
     ```

     Use `--to-type` to add the field to a page type or custom type instead.

     ```sh
     npx prismic field add text title --to-type page
     ```

* **Slice Machine:**

  1. **Open Slice Machine**

     In your Prismic project, start Slice Machine to begin editing content models.

     ```sh
     npx start-slicemachine --open
     ```

  2. **Add a text field**

     In Slice Machine, navigate to the slice, page type, or custom type you want to modify. Add a **text** field.

     The **label** determines the label shown to content writers in the [Page Builder](https://prismic.io/docs/guides/page-builder.md). Use an easily understandable name.

     The **API ID** determines the property name in the Content API. Use a short, snake-cased name.

# Use text fields

Text fields can be used like a string in JavaScript.

**Next.js example:**

```tsx
<p>My name: {slice.primary.name}</p>
```

**Nuxt example:**

```vue-html
<p>My name: {{ slice.primary.name }}</p>
```

**SvelteKit example:**

```svelte
<p>My name: {slice.primary.name}</p>
```

# Check if a text field has a value

Use `isFilled.keyText()` from [`@prismicio/client`](https://prismic.io/docs/technical-reference/prismicio-client/v7.md) to check if a text field has a value.

```ts
import { isFilled } from "@prismicio/client";

if (isFilled.keyText(slice.primary.my_text_field)) {
  // Do something if `my_text_field` has a value.
}
```

[Learn more about `isFilled`](https://prismic.io/docs/technical-reference/prismicio-client/v7.md#isfilled)

# API response

Here is what a text field looks like from the Content API:

```json
{
  "example_text": "Lorem ipsum"
}
```
