> ## Documentation Index
> Fetch the complete documentation index at: https://docs.worldvisagroup.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Customize Notification Items

> Learn how to use render props in the Inbox component to customize the subject, body, avatar, default and custom actions, or the entire notification item.

WorldVisa exposes render props to customize parts of the default Inbox notification item - subject, body, avatar, default/custom actions, or the entire notification.

![Notification items](https://mintcdn.com/wv-enterprise/l3bkwl1N_3mOn9aW/images/developers/inbox/notification-item.png?fit=max\&auto=format\&n=l3bkwl1N_3mOn9aW\&q=85\&s=46a215b6313d361bab5376b9488212a0)

Each render prop receives the full notification object, giving you access to all the data needed to build a fully custom UI.

> [!NOTE]
>
> Use your application’s existing connection and authentication settings with these examples. [Set up Inbox](https://docs.worldvisagroup.com/developers/inbox/setup-inbox.md) covers the application identifier, subscriber, API and WebSocket URLs, and subscriber credentials.

## Customize notification subject

Use the `renderSubject` prop to provide a custom component for the notification's subject line while keeping the rest of the notification style intact.

![Customize notification subject](https://mintcdn.com/wv-enterprise/l3bkwl1N_3mOn9aW/images/developers/inbox/custom-notification-subject.png?fit=max\&auto=format\&n=l3bkwl1N_3mOn9aW\&q=85\&s=7af808e9e0f22d9b686ee849cd3420c8)

```tsx theme={null}
import { Inbox } from '@wv/react';
 
function PortalInbox() {
  return (
    <Inbox
      applicationIdentifier="YOUR_APPLICATION_IDENTIFIER"
      subscriber="YOUR_SUBSCRIBER_ID"
      renderSubject={(notification) => (
        <strong>{notification.subject?.toUpperCase()}</strong>
      )}
    />
  );
}

export default PortalInbox;
```

## Customize notification body

Use `renderBody` if you want to keep the default Inbox UI and only change how the body is rendered. This is useful when you want to customize content formatting or include additional fields from the data object.

![Customize notification body](https://mintcdn.com/wv-enterprise/l3bkwl1N_3mOn9aW/images/developers/inbox/custom-notification-body.png?fit=max\&auto=format\&n=l3bkwl1N_3mOn9aW\&q=85\&s=00b2b164bb13f5172d1f055f11883041)

```tsx theme={null}
import { Inbox } from '@wv/react';
 
function PortalInbox() {
  return (
    <Inbox
      applicationIdentifier="YOUR_APPLICATION_IDENTIFIER"
      subscriber="YOUR_SUBSCRIBER_ID"
      renderBody={(notification) => (
        <div>
          <p>🔔 New alert: {notification.body}</p>
        </div>
      )}
    />
  );
}

export default PortalInbox;
```

## Customize notification avatar

Use the `renderAvatar` prop to replace the default notification avatar with your own custom component. This allows you to display user images, icons, or any other visual element that fits your application's design.

![Customize the notification avatar](https://mintcdn.com/wv-enterprise/l3bkwl1N_3mOn9aW/images/developers/inbox/customize-notification-avatar.png?fit=max\&auto=format\&n=l3bkwl1N_3mOn9aW\&q=85\&s=9358375cdf5cd89f21071f8326402d46)

```tsx theme={null}
import { Inbox } from '@wv/react';
 
function PortalInbox() {
  return (
    <Inbox
      applicationIdentifier="YOUR_APPLICATION_IDENTIFIER"
      subscriber="YOUR_SUBSCRIBER_ID"
      renderAvatar={(notification) => (
        <div className="w-8 h-8 rounded-full bg-gray-200 text-gray-700 flex items-center justify-center text-sm font-bold">
          VY
        </div>
      )}
    />
  );
}

export default PortalInbox;
```

## Customize notification actions

WorldVisa provides render props to customize actions:

### Default actions

Use the `renderDefaultActions` prop to override the default action buttons for notifications, such as "Archive," "Mark as Read," and "Snooze."

![Customize the default actions](https://mintcdn.com/wv-enterprise/l3bkwl1N_3mOn9aW/images/developers/inbox/customize-default-actions.png?fit=max\&auto=format\&n=l3bkwl1N_3mOn9aW\&q=85\&s=246078f00f7da8eb9aae3a63b81accff)

```tsx theme={null}
import { Inbox } from '@wv/react';
import { Archive, Check } from 'lucide-react';
 
function PortalInbox() {
  return (
    <Inbox
      applicationIdentifier="YOUR_APPLICATION_IDENTIFIER"
      subscriber="YOUR_SUBSCRIBER_ID"
      renderDefaultActions={(notification) => (
        <div className="flex gap-2">
          <button
            className="p-1 text-green-600 hover:text-green-800"
            type="button"
            onClick={() => notification.read()}
            title="Mark as read"
          >
            <Check className="w-4 h-4" />
          </button>
          <button
            className="p-1 text-gray-500 hover:text-gray-700"
            type="button"
            onClick={() => notification.archive()}
            title="Archive"
          >
            <Archive className="w-4 h-4" />
          </button>
        </div>
      )}
    />
  );
}

export default PortalInbox;
```

### Custom actions

Use the `renderCustomActions` prop to override the primary and secondary actions buttons with your own action button. This is useful for creating unique design and interactions specific to your application.

![Customize the custom actions](https://mintcdn.com/wv-enterprise/l3bkwl1N_3mOn9aW/images/developers/inbox/customize-custom-actions.png?fit=max\&auto=format\&n=l3bkwl1N_3mOn9aW\&q=85\&s=4e528eda59b7c1ace27992d34b19c743)

```tsx theme={null}
import { Inbox } from '@wv/react';
 
function PortalInbox() {

  const primaryButtonStyle = {
    border: 'none',
    padding: '5px 10px',
    borderRadius: '6px',
    cursor: 'pointer',
    fontSize: '12px',
    background: '#FB4CA3',
    color: 'white',
    boxShadow: '0 1px 2px rgba(0,0,0,0.1)',
  };

  const secondaryButtonStyle = {
    border: '1px solid #E0E0E0',
    padding: '5px 10px',
    borderRadius: '6px',
    cursor: 'pointer',
    fontSize: '12px',
    background: '#00B698',
    color: '#ffffff',
  };

  return (
    <Inbox
      applicationIdentifier="YOUR_APPLICATION_IDENTIFIER"
      subscriber="YOUR_SUBSCRIBER_ID"
      renderCustomActions={(notification) => {
        return (
          <div style={{ display: 'flex', gap: '10px', marginTop: '12px' }}>
            {notification.secondaryAction && (
              <button
                type="button"
                onClick={() => notification.completeSecondary()}
                style={secondaryButtonStyle}
              >
                {notification.secondaryAction.label}
              </button>
            )}
            {notification.primaryAction && (
              <button 
                type="button"
                onClick={() => notification.completePrimary()}
                style={primaryButtonStyle}
              >
                {notification.primaryAction.label}
              </button>
            )}
          </div>
        );
      }}
    />
  );
}

export default PortalInbox;
```

## Customize the entire notification item

Use the `renderNotification` prop to customize the entire notification item in the Inbox UI, including the container, layout, and the content of the subject and body of each notification.

> [!WARNING]
>
> While `renderNotification` gives you full control over the notification UI, it is **not recommended** for most use cases. Using it means you will have to **re-create the Inbox component built-in actions** like mark as read, archive snooze, and other interaction tooltips yourself.

![Customize entire notification item](https://mintcdn.com/wv-enterprise/l3bkwl1N_3mOn9aW/images/developers/inbox/custom-notification.png?fit=max\&auto=format\&n=l3bkwl1N_3mOn9aW\&q=85\&s=1b977a8c32778997c9a5e19cfcf48260)

```tsx theme={null}
import { Inbox } from '@wv/react';
 
function PortalInbox() {
  return (
    <Inbox
      applicationIdentifier="YOUR_APPLICATION_IDENTIFIER"
      subscriber="YOUR_SUBSCRIBER_ID"
      renderNotification={(notification) => (
        <div style={{ padding: '10px', border: '1px solid #ccc', marginBottom: '10px' }}>
          <h3>{notification.subject}</h3>
          <p>{notification.body}</p>
        </div>
      )}
    />
  );
}

export default PortalInbox;
```


## Related topics

- [OneSignal Push Integration with WorldVisa](https://docs.worldvisagroup.com/developers/integrations/push/onesignal.md)
- [Multi-tenancy](https://docs.worldvisagroup.com/developers/inbox/advanced-features/multi-tenancy.md)
- [How do workflows work in WorldVisa?](https://docs.worldvisagroup.com/developers/concepts/workflows.md)
- [Preferences](https://docs.worldvisagroup.com/developers/concepts/preferences.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.