🎨Style and Customization

Overview

Memori offers several ways to customize the appearance and behavior of the widget, letting you tailor it to fit your website or application's design. Customizations can be applied through CSS variables, custom layouts, and component overrides.

CSS Variables

The customization system is primarily based on CSS variables that control colors, dimensions, spacing, and other visual aspects of the widget.

Base Variables

:root {
  /* Primary colors */
  --memori-primary: rgb(102, 103, 171);
  --memori-primary-text: #fff;
  --memori-text-color: #000;
  
  /* Background and containers */
  --memori-inner-bg: transparent;
  --memori-chat-bubble-bg: #ffffff60;
  --memori-blur-background: 0px;
  
  /* Buttons */
  --memori-button-bg: #fff;
  --memori-button-text: #000;
  --memori-button-radius: 5px;
  --memori-button-padding: 0.5rem 1.5rem;
  --memori-button-border-color: #d9d9d9;
  --memori-button-box-shadow: 0 2px 0 rgba(0, 0, 0, 0.02);
  
  /* Drawer and Modal */
  --memori-drawer--width: 100%;
  --memori-drawer--width--md: 80%;
  --memori-drawer--width--lg: 60%;
  --memori-modal--width: 100%;
  --memori-modal--width--md: 80%;
  
  /* States */
  --memori-error-color: #ff4d4f;
}

Customization Examples

Dark Theme

Light Theme

Custom Layouts

You can define fully custom layouts using the React component.

Basic Example

Layout-Specific Styles

Responsive Customization

Component Overrides

You can override the default components for even deeper customization.

Example: Custom Chat Bubble

Best Practices

  1. Maintain Consistency

    • Use colors and styles consistent with your brand;

    • Keep the same palette throughout the widget.

  2. Accessibility

    • Ensure sufficient contrast between text and background;

    • Keep font sizes readable;

    • Consider users with visual impairments.

  3. Responsive Design

    • Test on different devices and screen sizes;

    • Use appropriate breakpoints;

    • Adapt layouts and dimensions for mobile devices.

  4. Performance

    • Avoid heavy animations;

    • Optimize images and assets;

    • Minimize the use of complex CSS filters and effects.

Demo

We put together a demo showing a theme customization example using the "Giuseppe Verdi" Agent. Feel free to tweak the style to your liking.

Last updated