```tsx
import {createAiChat} from '@nlux/core';
import {createChatAdapter} from '@nlux/[Your Adapter Of Choice]';

// The adapter config to provide via with<property> methods
const adapter = createChatAdapter()
    .withUrl('https://<Your Adapter Endpoint Url>') // Depends on the adapter
    .withApiKey('<Your Adapter API Key>'); // Depends on the adapter

// Create the chat UI without rendering it
const aiChat = createAiChat().withAdapter(adapter);

document.addEventListener('DOMContentLoaded', () => {
    // Rendering the chat UI
    const chatContainer = document.getElementById('chat-container');
    aiChat.mount(chatContainer);
});

document.getElementById('myCloseChatButton').addEventListener('click', () => {
    // Unmounting the chat UI when it's no longer needed
    aiChat.unmount();
});
```
