Function bubble

Creates a bubble component that can display various types of content.

Either the content to display or the options object. When an object, it can have the following properties:

Configuration object

Width of the bubble (e.g., '200px', 300)

CSS class name for custom styling

Fixed position of the bubble it can be one of the values: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'

Enable/disable drag functionality

{React.CSSProperties} - Inline styles object

URL of the image to display

Icon element to display that can be a string or a React node

Header title text

Header description text

The content to display (only used when options are provided or when no options are provided)

A JSX element representing the bubble component

  • The optionsOrContent is either the content to display or the options object.
  • The content is the content to display when the optionsOrContent is an object.
  • The bubble function can be used to display a bubble with a headerBar and group.

Basic usage with just content

bubble('Hello World');

Usage with options and other component blocks

bubble({title: 'Header title', description: 'Header description', overlay: true},[
group([
inputField({
name: 'firstName',
label: 'First name',
defaultValue: 'Mark',
}),
]),
]);

Usage with other component blocks

bubble([
headerBar({title: 'Modular UI form'}),
group([
inputField({
name: 'firstName',
label: 'First name',
defaultValue: 'Mark',
}),
]),
]);