# Post Rendering

## **Custom Post Rendering**

UIKit provides default renderers for the core data types: text, image, and file. It also provides a way to render your own UI for your custom post.

### **Post Structure**

A single post UI is composed of 1 or more blocks. This allows reusability of block components such as header or footer which can be shared by different kinds of posts.

<figure><img src="/files/63QN6LhIQ1AwvE3F6ZGb" alt=""><figcaption><p>Text post structure</p></figcaption></figure>

This is an example of an image post which contains three tableview cells. Top cell represents the header, middle cell contains content and bottom cell is footer cell.

{% hint style="info" %}
For now, we only export footer from `UIKit` - `AmityPostEngagementBar`.
{% endhint %}

### **Creating UI for custom posts**

Firs&#x74;**,** you need to create your custom renderer.

```javascript
import { AmityPostContainer, AmityPostEngagementBar } from '@amityco/ui-kit';

function CustomPostRenderer({ className, post }) {
  return (
    <AmityPostContainer className={className}>
      ...

      <AmityPostEngagementBar postId={post.postId} />
    </AmityPostContainer>
  );
}
```

Then, you need to pass your renderer into `AmityUiKitProvider`

```javascript
function MyApp() {
  return (
    <AmityUiKitProvider
      postRenderers={{
        customPostDataType: (props) => <CustomPostRenderer {...props} />,
        image: (props) => <CustomImagePostRenderer {...props} />,
      }}
    >
      ...
    </AmityUiKitProvider>
  );
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.social.plus/social-plus-uikit/uikit-3/web/social-uikit/overriding-uikit-behaviour/post-rendering.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
