ReferenceSchema API
s.enum()
A string that must be one of a fixed set of values, chosen from a dropdown.
Use it for
- Button variants, alignments and sizes
- Any choice with a short, closed list of options
Reference
s.enum(...values)
schemaA string that must be one of the values you list. Editors get a dropdown, in the order the values are given. The value is never stega encoded, so you can compare it with the exact strings in your code.
In Val Studio
Methods
.nullable()
Let the editor choose none of them.
Example
A button variant
button.val.ts