Customizing React UI

Swap out MinChat React UI comnponents with your own.

MinChat provides the capability to substitute parts of the User Interface (UI) with your own by passing down render functions. This feature empowers you to modify, personalize, and conceal certain UI elements, thereby enabling you to customize the chat experience to suit your website's needs.

import React from 'react';
import { MinChatUI } from '@minchat/reactui';

function App() {
	return (
		<MinChatUI
	        	user={{username: "john", name: "John"}}
		        apiKey="AABBCCDDEEFFGGHHIIJJKKLL0"
		
			// Customize functionality
			showAttachButton={false}
			showSendButton={false}
			disableInput={true}
			
			// Customize UI Components
			height='100vh'
		        themeColor='#6ea9d7'
		        renderChatList={({connectedUser, chats, loading, selectedChat, paginate, openChat, isMobile}) => <div></div> }
		        renderChatItem={({chat, isMobile}) => <div></div> }
			renderEmptyChats={({isMobile}) => <div></div> }
			renderChatListHeader={({isMobile}) => <div></div> }
			renderLoader={({isMobile}) => <div></div> }
	  		renderMessageList={({connectedUser, messages, loading, paginate, typingUser, isMobile}) => <div></div> }
	  		renderEmptyMessages={({isMobile}) => <div></div> }
			renderInput={({sendMessage, sendFile, inputProps, isMobile}) => <input {...inputProps} /> }
	  		renderMessageListHeader={({heading, clearMessageList, lastActive, isMobile}) => <div></div> }
	  		renderIsTyping={({user, isMobile}) => <div></div> }
		/>
	);
}

export default App;

Functionality Customization

Hide File Attachment Button

the showAttachButton property is used to show or hide the file attachment button on the left of the message input. The default value is true.

Hide Send Button

The showSendButton property is used to show or hide the send button on the right of the message input. The default value is true.

Disable Message Input

The disableInput property is used to disable the message input field and not allow anything to be typed or sent. The default value is false.

UI Customization

Height

The height property is used to determine the height of the MinChat UI in CSS. the default value is 100vh

Theme

The theme property is used to set the color scheme of the MinChat User Interface (UI). It takes a CSS color code as its value.

Render Chat List


renderChatList={({connectedUser, chats, loading, selectedChat, paginate, openChat, isMobile}) => <div></div> }

Render Chat Item


renderChatItem={({chat, isMobile}) => <div></div> }

Render Empty Chats


renderEmptyChats={({isMobile}) => <div></div> }
  			  		

Render Chat List Header


renderChatListHeader={({isMobile}) => <div></div> }

Render Loader


renderLoader={({isMobile}) => <div></div> }

Render Message List


renderMessageList={({connectedUser, messages, loading, paginate, typingUser, isMobile}) => <div></div> }

Render Empty Messages


renderEmptyMessages={({isMobile}) => <div></div> }

Render Input


renderInput={({sendMessage, sendFile, inputProps, isMobile}) => <input {...inputProps} /> }

Render Message List Header


renderMessageListHeader={({heading, clearMessageList, lastActive, isMobile}) => <div></div> }

Render Is Typing


renderIsTyping={({user, isMobile}) => <div></div> }

Last updated