Superform by Delta Clan
โœจ ClonablesSocialResourcesSuperform Home
v2
v2
  • ๐ŸGetting Started
    • Introduction
    • Quick Start
  • ๐Ÿซ€Essentials
    • Form Container
    • Step Container
    • Navigation - Overview
      • Direct
      • Logic / Conditional
      • Hook
    • Variables
      • Form Data ($f)
      • Step Index ($s)
      • Progress Percentage ($p)
      • Scoring Variables ($v)
    • Progress Bar
    • Reset
    • Radio Groups
    • Checkbox Groups
    • Cheatsheet
  • โš™๏ธGlobal Options
    • Step Delay Controls
    • Animations
      • Step Animation
      • Step Animation Duration
      • Step Animation Ease
    • Save Data & Progress
    • Pre-fill Form
    • Prevent Content Flash
    • Debug
    • Third-party Integrations
    • Cheatsheet
  • ๐ŸŽ›๏ธInput Validation & Errors
    • Validation
      • length()
      • words()
      • minmax()
      • checkbox()
      • must()
      • hook()
    • Error Management
      • Automatic Error Setup
      • Manual Error Setup
  • โšกReactivity
    • Update Text
    • Visibility
    • Class Toggle
    • Value
    • Set Attribute
  • ๐Ÿ”ขScore Tracking
    • Score Setup & Calculation
    • Score Ranking
  • โŒจ๏ธAccessibility
    • Enter & Backspace Bindings (โ†ฉ, โŒซ)
    • Checkbox & Radio Bindings
  • ๐Ÿ› ๏ธJavascript SDK
    • Intro to Superform API
    • Superform Instance
    • Cheatsheet
  • ๐Ÿ“–Additional Resources
    • WTF is an expression ? ๐Ÿ†•
    • Integrations
    • Tutorials
    • Changelog
    • FAQ ๐Ÿšง
    • Join Discord
Powered by GitBook
On this page
  • Definition
  • Example expressions
  • ๐Ÿ‘‹ Live name preview
  • ๐Ÿงฎ Show total price
  • ๐Ÿ”ž Show warning if underage
  • ๐ŸŸฉ Highlight selected plan
  • โœ… Show message based on score with ternary operator (advanced)
  • ๐Ÿชœ Highlight the active step visually (advanced)
  • What can I use inside Expressions

Was this helpful?

  1. Additional Resources

WTF is an expression ? ๐Ÿ†•

For no-code and low-code users who want to build smarter forms without writing code.

Definition

An expression is a tiny formula that tells Superform:

โ€œWatch this input, and when it changesโ€ฆ do something.โ€

or

โ€œIf this happens โžœ do that.โ€

Itโ€™s just logic. Like what youโ€™d use in a calculator or spreadsheet:

2 + 2         // โ†’ 4
$f.age > 18   // โ†’ true
$f.price * $f.quantity  // โ†’ 2 * 18 = 36

You use expressions inside attributes like sf-react and Superform updates the DOM (HTML elements) automagically.

Example expressions

๐Ÿ‘‹ Live name preview

<p>Welcome back <span sf-react="text($f.name)">Name</span></p>

โ†’ $f.name comes from an <input name="name">.

โ†’ Updates the span with what the user typed in the name input.

๐Ÿงฎ Show total price

<p>Total: <span sf-react="text($f.price * $f.quantity)">0</span>โ‚ฌ</p>

โ†’ $f.price and $f.quantity come from <input name="price"> and <input name="quantity">.

โ†’ Calculates and displays price ร— quantity as the user types/selects quantities.

๐Ÿ”ž Show warning if underage

<div sf-react="visibility($f.age < 18)">
  <p>You must be 18+ to continue.</p>
</div>

โ†’ $f.age comes from an <input name="age" type="number">.

โ†’ Shows the message only if the entered age is under 18.

๐ŸŸฉ Highlight selected plan

<div sf-react="class($f.plan === 'pro', 'active')">Pro Plan</div>

โ†’ $f.plan comes from a group of radio buttons or a <select name="plan">.

โ†’ Toggles the active class when the selected plan is "pro".

โœ… Show message based on score with ternary operator (advanced)

<p sf-react="text($v.score > 5 ? 'Great job!' : 'Keep going!')">...</p>

โ†’ $v.score is a custom score variable calculated using sf-score-calc.

โ†’ Shows "Great job!" if the score is above 5, otherwise "Keep going!".

๐Ÿชœ Highlight the active step visually (advanced)

<div sf-react="class($s === 2, 'active-step')">Step 3</div>

โ†’ $s is the current step index (starts at 0).

โ†’ Adds the active-step class only when you're on Step 3 (index 2).

Useful for styling progress indicators, steppers, or conditional content blocks.


What can I use inside Expressions

Inside expressions, you can combine:

  • โœ… Superform variables like $f, $s, $p, and $v

  • โœ… Superform functions like text(), value(), visibility(), class(), and attr()

  • โœ… Basic JavaScript logic like math, comparisons, strings, and ternary operators

Variable
Meaning

$f

Form data (like $f.name, $f.email, etc)

$s

Current step index (useful in multistep forms)

$p

Progress value (%)

$v

Score variables ($v.totalScore, etc)

๐Ÿ› ๏ธ Reactivity features

Function
What it does

text(value)

Updates the elementโ€™s text

value(value)

Sets the value of an input or element

visibility(condition)

Show/hide the element

class(condition, 'classname')

Adds a class if true

attr(value, 'attribute')

Sets a custom attribute


Last updated 1 month ago

Was this helpful?

Refer to reactivity for more information and Webflow examples!

Refer to reactivity for more information and Webflow examples!

Refer to reactivity for more information and Webflow examples!

Refer to feature for more information and Webflow examples!

Refer to and feature for more information and Webflow examples!

Refer to feature and variable for more information and Webflow examples!

๐Ÿง  Variables overview (see )

๐Ÿ“–
Update Text
Update Text
Visibility
Class Toggle
Update Text
Score Setup & Calculation
Class Toggle
Progress Percentage ($p)
Variables