---
title: "User element"
summary: "Renders as a mention of a user."
url: "https://docs.slack.dev/reference/block-kit/block-elements/user-element"
type: "reference"
subtype: "block-kit"
available_in_surfaces:
  - "Modals"
  - "Messages"
  - "Home tabs"
works_with_blocks:
  - "Rich text"
---

Source: https://docs.slack.dev/reference/block-kit/block-elements/user-element

# User element

This is a rich text element, compatible only with the [`rich_text`](https://docs.slack.dev/reference/block-kit/blocks/rich-text-block.md) block. It must be used within the [`rich_text_list`](https://docs.slack.dev/reference/block-kit/block-elements/rich-text-list-element.md), [`rich_text_quote`](https://docs.slack.dev/reference/block-kit/block-elements/rich-text-quote-element.md), or [`rich_text_section`](https://docs.slack.dev/reference/block-kit/block-elements/rich-text-section-element.md) block element within the `rich_text` block's `elements` array.

## Fields {#fields}

Field

Type

Description

Required?

`type`

String

The type of object; in this case, "user".

Required

`user_id`

String

The ID of the user to be mentioned.

Required

`style`

Object

An object of optional boolean properties that dictate style: `bold`, `italic`, `strike`, `highlight`, `client_highlight`, `underline`, and `unlink`.

Optional

`from_llm`

Boolean

Indicates whether the user was generated by the LLM itself.

Optional

## Example {#example}

*   JSON
*   Python Slack SDK
*   Node Slack SDK
*   Java Slack SDK

```
{    "blocks": [        {            "type": "rich_text",            "elements": [                {                    "type": "rich_text_section",                    "elements": [                        {                            "type": "user",                            "user_id": "U123ABC456"                        }                    ]                }            ]        }    ]}
```

[View in Block Kit Builder](https://app.slack.com/block-kit-builder/#%7B%2522blocks%2522%3A%255B%257B%2522type%2522%3A%2522rich_text%2522%2C%2522elements%2522%3A%255B%257B%2522type%2522%3A%2522rich_text_section%2522%2C%2522elements%2522%3A%255B%257B%2522type%2522%3A%2522user%2522%2C%2522user_id%2522%3A%2522U123ABC456%2522%257D%255D%257D%255D%257D%255D%257D)

```python
def example01() -> RichTextBlock:
    """
    Renders as a mention of a user.
    https://docs.slack.dev/reference/block-kit/block-elements/user-element/

    A rich text block with a user mention in a section.
    """
    block = RichTextBlock(
        elements=[
            RichTextSectionElement(
                elements=[
                    RichTextElementParts.User(user_id="U123ABC456"),
                ]
            )
        ]
    )
    return block
```

```javascript
export function example01() {
  /**
   * @type {import('@slack/types').RichTextBlock}
   */
  const block = {
    type: "rich_text",
    elements: [
      {
        type: "rich_text_section",
        elements: [
          {
            type: "user",
            user_id: "U123ABC456",
          },
        ],
      },
    ],
  };
  return block;
}
```

```java
public static RichTextBlock example01() {
    RichTextBlock block = Blocks.richText(rt -> rt.elements(List.of(RichTextSectionElement.builder()
            .elements(List.of(RichTextSectionElement.User.builder()
                    .userId("U123ABC456")
                    .build()))
            .build())));
    return block;
}
```
