---
url: /en/docs/fields/markdown.md
description: >-
  Create and format content in Sveltia CMS with Markdown syntax and rich text
  editing.
---

# Markdown Field

The Markdown field type is an alias of the RichText field type, available for backward compatibility with Netlify/Decap CMS. It provides a rich text editor that allows content editors to create and format content using Markdown syntax.

The `widget` property for this field type is `markdown`.

See the [RichText field documentation](/en/docs/fields/richtext) for details on the UI, data type, and available options.

Note that the [`format`](/en/docs/fields/richtext#format) option is not available for the Markdown field type since it is fixed to `markdown`. Use the RichText field type to save HTML.

## Examples

### Standard Markdown Field

This example shows a basic Markdown editor with default settings.

::: code-group

```yaml [YAML]
- name: body
  label: Body
  widget: markdown
```

```toml [TOML]
[[fields]]
name = "body"
label = "Body"
widget = "markdown"
```

```json [JSON]
{
  "name": "body",
  "label": "Body",
  "widget": "markdown"
}
```

```js [JavaScript]
{
  name: 'body',
  label: 'Body',
  widget: 'markdown',
}
```

:::

Output example:

::: code-group

```markdown [Markdown]
# Welcome to the Markdown Field

This is a sample paragraph in **Markdown** format.

- Item 1
- Item 2
```

```yaml [YAML]
body: |
  # Welcome to the Markdown Field

  This is a sample paragraph in **Markdown** format.

  - Item 1
  - Item 2
```

```toml [TOML]
body = """
# Welcome to the Markdown Field

This is a sample paragraph in **Markdown** format.

- Item 1
- Item 2
"""
```

```json [JSON]
{
  "body": "# Welcome to the Markdown Field\n\nThis is a sample paragraph in **Markdown** format.\n\n- Item 1\n- Item 2\n"
}
```

:::

We have included a Markdown example output along with YAML, TOML, and JSON representations because a field named `body` with the Markdown field type would be stored outside of the frontmatter in a Markdown file. If the name of the field were different, the content would be stored in the frontmatter instead. This behavior can be configured using the [`body_field` option](/en/docs/collections/entries/formats#body-field-for-front-matter-formats) for collections and collection files.
