SLB field types and validation rules

SLB supports 13 general field types, four WooCommerce types and two layout helpers. Declare them under settings (or inside a block’s settings) in the section schema.

General fields

Type Use for
text Single-line text
textarea Multi-line text
richtext HTML content
image An image from the media library
url A link
video_url A video link
color A colour picker
number A number
range A numeric range value
select One choice from a list of options
toggle On or off
page A WordPress page picker
spacing_box Per-instance margin and padding through a visual spacing box

WooCommerce fields

Type Use for
product A single product picker
product_list A list of products
category A product category picker
collection_source A product collection source

WooCommerce types need WooCommerce active. See the WooCommerce guide.

Layout helpers

header and paragraph are organizer types. They need no id and save no value; they only structure the editor panel.

Validation

Rule Applies to
required Any field
min_length, max_length Text fields (a character counter shows when max_length is set)
min, max Number fields

Rules run in the editor and again on the server.

Conditional fields

Add visible_if to a field to show it only when another field has a certain value. The operators are eq, neq and in.

Related: SLB documentation · Getting started · Free vs paid

Last updated