Skip to Content
← Back to all demos

Readonly Mode

Toggle readonly mode at runtime with customizable indicator badges and configurable interaction controls

Runtime toggle APICustom indicator badgeConfigurable allowCopyEvent monitoringUse case examples

Readonly Mode Controls

Toggle readonly mode and configure options to see the widget behavior change in real-time.

What Gets Disabled

  • Message input field
  • Send button
  • Feedback buttons (thumbs up/down, stars, emoji)
  • Action buttons from responses
  • Menu button (clear chat, etc.)
  • Disclaimer accept button
  • Copy button (configurable via allowCopy)

API Usage

// Initialize widget
const widget = window.NexusChatWidget.init({
  experienceId: "your-experience-id",
  apiUrl: "undefined"
});

// Simple enable/disable
widget.setReadOnly(true);
widget.setReadOnly(false);

// With indicator badge
widget.setReadOnly(true, {
  indicator: {
    show: true,
    text: "Maintenance Mode",
    backgroundColor: "#FEF3C7",
    textColor: "#92400E"
  }
});

// Disable copy button in readonly mode
widget.setReadOnly(true, {
  allowCopy: false
});

// Listen for state changes
widget.on('readOnlyChange', (data) => {
  console.log('Readonly:', data.readOnly);
  console.log('Indicator:', data.indicator);
});

Event Monitor

Toggle readonly mode to see events...

Use Cases

Maintenance Mode

Disable interactions during backend maintenance while users can still read previous conversations.

Session Review

Allow supervisors to review chat sessions without accidentally sending messages.

Rate Limiting

Temporarily disable input when rate limits are hit, showing an indicator with remaining wait time.

Demo/Preview Mode

Show a read-only preview of the chat widget before users sign in or complete onboarding.