Building your first Wix app with Wix Blocks

Module 47: How to Build a Wix App: Complete Developer Guide | Lesson 533 of 687 | 60 min read

By Michael Andrews, Wix SEO Expert UK

Wix Blocks is the fastest way to build and publish a Wix app without managing servers, writing React code, or configuring a build pipeline. It combines a visual drag-and-drop editor with Velo (Wix's JavaScript coding environment) to let you create powerful widgets, dashboard panels and configuration interfaces. This lesson takes you from a blank Blocks project to a working app with a site widget, a settings panel, and API connectivity.

What is Wix Blocks and When to Use It

Wix Blocks is a browser-based development environment where you build apps visually. Think of it as the Wix Editor, but instead of building websites, you are building app components that other Wix users can install on their sites. Every element you create in Blocks becomes a reusable component that adapts to the site owner's theme, layout and content.

Wix Blocks editor interface showing widget designer with drag-and-drop components
The Wix Blocks editor: visual widget design on the left, properties panel on the right, code editor at the bottom.

Creating Your First Blocks App

Build a Wix Blocks app from scratch step by step

Building a Widget: Practical Example

Let us build a practical example: an SEO score display widget that shows the site owner's SEO health score, key metrics, and improvement suggestions. This demonstrates all the core Blocks concepts you need.

Step 1: Design the Widget Layout

Step 2: Define Widget Properties

Properties let site owners customise your widget. In the Properties panel, define the settings that should be configurable.

Step 3: Add Widget Code

The code editor at the bottom of the Blocks interface is where you add logic. The widget code runs in the site context and can access Wix APIs, fetch data, and respond to user interactions.

// Widget code (runs on the site)
$widget.onPropsChanged((oldProps, newProps) => {
  // Update UI when site owner changes properties
  if (newProps.title !== oldProps.title) {
    $w('#titleText').text = newProps.title;
  }
  if (newProps.showDetails !== oldProps.showDetails) {
    $w('#metricsRepeater').collapsed = !newProps.showDetails;
  }
});

$w.onReady(async () => {
  // Set initial values from properties
  $w('#titleText').text = $widget.props.title;
  $w('#metricsRepeater').collapsed = !$widget.props.showDetails;

  // Fetch SEO data (example using an HTTP function)
  try {
    const response = await fetch('https://your-api.com/seo-score', {
      method: 'POST',
      body: JSON.stringify({ siteUrl: window.location.hostname }),
    });
    const data = await response.json();

    $w('#scoreText').text = String(data.score);
    $w('#progressBar').value = data.score;

    // Populate the metrics repeater
    $w('#metricsRepeater').data = data.metrics.slice(0, $widget.props.maxItems);
    $w('#metricsRepeater').onItemReady(($item, itemData) => {
      $item('#metricLabel').text = itemData.label;
      $item('#metricValue').text = itemData.value;
    });
  } catch (error) {
    $w('#scoreText').text = '--';
    $w('#progressBar').value = 0;
  }
});

Creating a Dashboard Panel

Dashboard panels appear in the site owner's Wix admin area. They provide app settings, analytics and management interfaces. In Blocks, dashboard panels are created separately from site widgets.

Add a dashboard panel to your Blocks app

Design Presets and Responsive Layouts

Wix Blocks widgets must work across thousands of different site designs. You achieve this through design presets and responsive layout settings.

Blocks Pro Tip: Create at least 3 design presets for your widget. App Market listings with multiple presets get significantly more installs because site owners can see that the widget will match their specific design style.

Connecting Blocks Apps to Wix APIs

Blocks apps can access the full range of Wix APIs through Velo. This includes Wix Data, Wix CRM, Wix Stores, Wix Bookings, Wix Members and more.

// Backend code in Blocks (runs server-side)
import wixData from 'wix-data';

export async function getAppSettings(siteId) {
  const result = await wixData.query('AppSettings')
    .eq('siteId', siteId)
    .find();

  return result.items.length > 0
    ? result.items[0]
    : { siteId, score: 0, lastChecked: null };
}

export async function saveAppSettings(settings) {
  const existing = await wixData.query('AppSettings')
    .eq('siteId', settings.siteId)
    .find();

  if (existing.items.length > 0) {
    return wixData.update('AppSettings', {
      ...existing.items[0],
      ...settings
    });
  }
  return wixData.insert('AppSettings', settings);
}
Blocks Limitations to Know: Wix Blocks does not support npm packages, custom build tools, or server-side Node.js. If your app needs these capabilities, you must use the CLI approach covered in the next lesson. Blocks is powerful for most use cases, but complex apps with third-party integrations often outgrow it.

This lesson on Building your first Wix app with Wix Blocks is part of Module 47: How to Build a Wix App: Complete Developer Guide in The Most Comprehensive Complete Wix SEO Course in the World (2026 Edition). Created by Michael Andrews, the UK's No.1 Wix SEO Expert with 14 years of hands-on experience, 750+ completed Wix SEO projects and 425+ verified five-star reviews.