Skip to main content

Canvas Component

The Canvas component provides a drag-and-drop interface for visually building view schemas. It allows users to add, edit, and arrange fields and components in a visual editor.

Features

  • Drag-and-Drop Interface: Intuitive interface for adding and arranging fields
  • Live Preview: Real-time preview of the view being created
  • Field Editing: In-place editing of field properties
  • Section Management: Group fields into logical sections
  • Responsive Layout: Supports different layout configurations

Basic Usage

Components

FieldPreview

The FieldPreview component displays a preview of a field in the canvas:

FieldEditor

The FieldEditor component provides an interface for editing field properties:

ViewPreview

The ViewPreview component renders a live preview of the current view schema:

Canvas Modes

The canvas supports different modes for different view types:
  • Form Mode: For building form views
  • Table Mode: For building table views
  • Detail Mode: For building detail views

Keyboard Shortcuts

The canvas supports the following keyboard shortcuts:
  • Delete: Remove the selected field
  • Ctrl+Z: Undo the last action
  • Ctrl+Y: Redo the last action
  • Ctrl+S: Save the current schema

Customization

You can customize the canvas appearance and behavior:

Integration with Other Components

The canvas works seamlessly with other View Builder components:

Advanced Usage

Custom Field Renderers

You can provide custom renderers for specific field types:

Layout Templates

You can provide predefined layout templates: