# 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="https://2352509137-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX0mOAVWkotGme0iRzu%2Fuploads%2FDbskBBDvSxemGkpkZIH5%2FScreenshot%202566-02-22%20at%2015.41.14.png?alt=media&#x26;token=1728b9f5-f046-4b8a-bec7-82a6255d8545" 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>
  );
}
```
