Swelıty
Tools for everyone

Free Online Visualforce Playground

Write Visualforce markup and see it drawn, with merge fields filled from JSON data you provide. An approximation of Visualforce (no controller, no Salesforce org), in your browser.

Press Run, or Ctrl or Cmd + Enter, to draw the page. This approximates Visualforce: no controller, and buttons do nothing.

Preview

Console

Output appears here. Press Run, or Ctrl or Cmd + Enter.

How to use

  1. Write or edit the page in the Page tab. It starts with apex:page, like a real Visualforce page.

  2. Open the Data tab and write the values the page reads as JSON, for example an account object and a list of contacts. This stands in for a controller.

  3. Use merge fields in text and attributes, such as {!account.Name}, {!contacts[0].Name}, {!contacts.size} or a formula like {!IF(account.Active, 'Open', 'Closed')}.

  4. Press Run, or Ctrl or Cmd + Enter. The preview shows the page and the Console shows warnings and errors, each with its line number.

  5. Use apex:repeat or apex:pageBlockTable with value="{!contacts}" and var="c" to draw one row or block per item.

  6. Download a zip with the drawn page as a standalone index.html, plus your page and data as source files.

Why use this tool

  • Page and Data tabs

    The markup and the JSON it reads live side by side. Change a value and press Run to see a different result.

  • Merge fields with formulas

    Everything inside {! } is read with the same formula engine as the Salesforce Formula Playground, so IF, CASE, TEXT, string and date functions work. Lists support .size, [0] and loops.

  • The common components

    Draws apex:page, form, pageBlock, pageBlockSection, pageBlockSectionItem, pageBlockButtons, pageBlockTable, dataTable, column, repeat, outputText, outputField, inputField, inputText, inputTextarea, inputCheckbox, selectList, selectOption, commandButton, commandLink, outputPanel, panelGrid, pageMessage, image, variable, outputLabel and facets, mixed with plain HTML.

  • Clear about what is missing

    Components that are not drawn (charts, apex:detail, includes, scripts and so on) appear as visible placeholder boxes and are listed in the Console, so nothing is dropped silently.

  • Errors with line numbers

    Unclosed tags, unknown attributes, bad merge fields and invalid JSON in the Data tab are reported with the line they are on.

  • Safe by design

    Output is escaped. Script elements and event handler attributes are removed, and the preview runs in an isolated frame with scripts switched off.

  • Runs in your browser

    No Salesforce account is needed. Not affiliated with or endorsed by Salesforce.

About this tool

Write Visualforce markup and see what it looks like, without a Salesforce org. The page goes in one tab and the values it reads go in another, as JSON: a stand-in for the variables a controller would give the page. Press Run and the markup is drawn with a plain business-form look, with merge fields such as {!account.Name} and {!IF(contacts.size > 0, 'Yes', 'No')} filled in from your data. It is an approximation, not Salesforce: there is no Apex controller, no server, and none of the real standard components or styles, so use it to sketch a layout, learn the tags and test merge-field logic, not to check how a page will look or behave in an org.

Frequently asked questions

No. It is an approximation written for this site. It reads Visualforce-style markup and draws it as ordinary HTML with its own generic styles. It is not Salesforce, does not use Salesforce code or styles, and a page that looks right here can still look different, or fail, in an org.

apex:page, form, pageBlock, pageBlockSection, pageBlockSectionItem, pageBlockButtons, pageBlockTable, dataTable, column, repeat, outputText, outputField, outputLabel, outputLink, inputField, inputText, inputTextarea, inputCheckbox, selectList, selectOption, commandButton, commandLink, outputPanel, panelGrid, pageMessage, pageMessages, image, variable, facet and param, plus plain HTML. Each one supports the common attributes (for example value, var, rendered, style, styleClass, title, columns), not every attribute of the real component.

Everything else. Charts, apex:detail, apex:enhancedList, related lists, flows, includes and templates, apex:iframe, selectRadio, selectCheckboxes, selectOptions, file upload, tabs, action components (actionFunction, actionSupport, actionPoller, actionStatus) and custom components. Each is drawn as a placeholder box and listed in the Console.

No. standardController, controller and extensions are accepted and ignored, and Apex is not run. The Data tab holds the values the page needs, such as an account object. Nothing loads records and nothing is saved.

No. Buttons and links are drawn so you can check the layout, but actions, rerender and form submission do nothing. Inputs are real form controls filled from your data and you can type in them, but the values go nowhere.

A plain reference such as {!account.Name} is looked up in your data. Anything longer is handed to the formula engine from the Salesforce Formula Playground. That engine is strict about types, as Salesforce is: join text and numbers with TEXT(). A whole record or list cannot be used inside a larger formula, only its fields, .size or an item. Names are not case sensitive. $User (with an invented sample user), $CurrentPage and an empty $Label are available. $Resource is not: there are no static resources.

Merge field results are HTML-escaped. With escape="false" on apex:outputText the HTML is cleaned first: scripts, event handlers and unsafe links are removed. Script elements and on-attributes in your page are removed with a note in the Console, and the preview has scripts switched off.

A repeat or table shows at most 1,000 items, and the Console says when it cut a list. A page that takes longer than 2 seconds to draw is stopped.

A zip with index.html, the drawn page with its CSS inline so it opens on its own, and a source folder with your page and your data. It is a static picture: it contains no Visualforce that you can deploy.

In your browser, where the page is drawn. This tool is not affiliated with or endorsed by Salesforce.