Skip to main content

HTML Widget

OverviewDirect link to Overview

The HTML widget allows you to embed custom HTML content directly into your interface. This widget provides complete flexibility for displaying rich content, custom layouts, or integrating third-party HTML components while maintaining full control over styling and behavior.

HTML Widget

Basic ConfigurationDirect link to Basic Configuration

Global SettingsDirect link to Global Settings

NameDirect link to Name

  • Field: Widget name identifier
  • Usage: Set a descriptive name for easy identification in the widget tree
  • Example: "Custom Header", "Product Description"

Variable/ModelDirect link to Variable/Model

  • Field: Model binding for the widget
  • Usage: Bind the widget to a data model or variable for dynamic content
  • Validation: The system validates model names and shows warnings for potential issues
HTML Basic Configuration

HTML Content EditorDirect link to HTML Content Editor

Edit HTML ButtonDirect link to Edit HTML Button

  • Location: Global section → Edit HTML
  • Function: Opens a code editor for writing custom HTML content
  • Features:
    • Syntax highlighting
    • Code completion
    • Error detection
    • Preview capabilities

Supported HTMLDirect link to Supported HTML

  • Standard HTML5 elements and attributes
  • Inline CSS styling
  • JavaScript integration (with platform security considerations)
  • Dynamic content using template variables

Template VariablesDirect link to Template Variables

Access dynamic data within your HTML content:

HTML Template Variables

Validation ConfigurationDirect link to Validation Configuration

Screen-Based ValidationDirect link to Screen-Based Validation

Configure widget behavior across different screens/contexts:

AvailableDirect link to Available

  • Purpose: Controls whether the widget exists in the DOM
  • Options:
    • Boolean toggle (true/false)
    • Advanced condition using JavaScript expressions

VisibleDirect link to Visible

  • Purpose: Controls widget visibility (display/hide)
  • Options:
    • Boolean toggle
    • Advanced condition with template variables
  • Advanced Example: userRole == 'admin'

RequiredDirect link to Required

  • Purpose: Makes the widget mandatory for form validation
  • Note: Primarily used when HTML widget contains form elements
  • Options: Boolean or conditional expression

DisableDirect link to Disable

  • Purpose: Disables interactive elements within the widget
  • Options: Boolean or conditional expression
HTML Screen-Based Validation

Style ConfigurationDirect link to Style Configuration

  • Field: Class names
  • Usage: Apply predefined CSS classes
  • Format: Space-separated class names
HTML Style

Widget Template StructureDirect link to Widget Template Structure

Generated ComponentDirect link to Generated Component

The widget generates a Vue.js component with:

  • Unique component ID
  • Reactive data binding
  • Conditional rendering
  • Event handling capabilities

DOM StructureDirect link to DOM Structure

<div
  id="[widgetId]"
  v-if="[visibilityCondition]"
  class="[staticClasses]"
  :class="[dynamicClasses]"
>
  <!-- Your custom HTML content -->
</div>

Integration ExamplesDirect link to Integration Examples

Basic HTML ContentDirect link to Basic HTML Content

<div class="custom-section">
  <h2>Welcome {{SF_connectedUser.firstName}}</h2>
  <p>Last login: {{models.lastLogin }}</p>
</div>

Interactive ElementsDirect link to Interactive Elements

<div class="interactive-widget" style="display: flex; align-items: center; gap: 12px;">
  <el-button type="primary" size="large" @click="customFunction">
    Click
  </el-button>

  <el-input v-model="models.inputValue" placeholder="Enter text" clearable style="max-width: 220px;" />
</div>

Conditional ContentDirect link to Conditional Content

<div v-if="models.isAdmin">
  <h3>Admin Panel</h3>
  <div class="admin-controls">
    <!-- Admin-specific content -->
  </div>
</div>

Best PracticesDirect link to Best Practices

Security ConsiderationsDirect link to Security Considerations

  • Sanitize user-generated content
  • Avoid inline JavaScript in production
  • Use platform-provided security features
  • Validate all dynamic data

Performance OptimizationDirect link to Performance Optimization

  • Minimize DOM complexity
  • Use efficient CSS selectors
  • Implement lazy loading for heavy content
  • Optimize images and media

AccessibilityDirect link to Accessibility

  • Include proper ARIA attributes
  • Ensure keyboard navigation support
  • Provide alternative text for images
  • Maintain proper heading hierarchy

MaintainabilityDirect link to Maintainability

  • Use semantic HTML structure
  • Comment complex functionality
  • Follow consistent naming conventions
  • Separate concerns (structure, style, behavior)

TroubleshootingDirect link to Troubleshooting

Common IssuesDirect link to Common Issues

Widget Not DisplayingDirect link to Widget Not Displaying

  • Check visibility conditions
  • Verify model bindings
  • Ensure proper HTML syntax
  • Review browser console for errors

Styling ProblemsDirect link to Styling Problems

  • Verify CSS class names
  • Check for conflicting styles
  • Ensure responsive design compatibility
  • Test across different screen sizes

Dynamic Content Not UpdatingDirect link to Dynamic Content Not Updating

  • Confirm model binding syntax
  • Check for reactivity issues
  • Verify data source connections
  • Review JavaScript console errors

Debug ModeDirect link to Debug Mode

Enable debug mode to:

  • View generated component structure
  • Monitor data binding updates
  • Track validation rule execution
  • Inspect DOM changes

Advanced FeaturesDirect link to Advanced Features

Form IntegrationDirect link to Form Integration

Include form elements that integrate with the platform's form system:

<div class="form-section">
  <label for="customField">Custom Input:</label>
  <el-input
    id="customField"
    v-model="model.customField"
    placeholder="Enter value"
    clearable
  ></el-input>
</div>

This HTML widget provides maximum flexibility while maintaining integration with the platform's validation, styling, and data binding systems. Use it when standard widgets don't meet your specific requirements or when you need complete control over the presentation layer.