Skip to content

InputField ​

<InputField name="x" value="3"> -- a field you type a value into, Wolfram's InputField. The text is Epsil, parsed when you press Enter or leave the field, and the binding _x is the expression it parses to: a number, a symbol, Sin(t), whatever was typed. Text that does not parse leaves the binding where it was and marks the field. type="number" accepts only a number, and size is the width in characters.

For a mathematical editor with typeset input, use <In>; this is the plain field a form wants.

Demos·packages/components/src/input-field-box.ts· draws InputField

Props

PropTypeDefaultNotes
namestring""The binding this field drives: name="x" fills the wildcard _x.reflects
valuestring""The starting text, as Epsil.
typestring"expression"expression (default) or number.
sizenumber8Width in characters.

As a web component

Plain custom elements, no framework required: import @enumeratio/frontend for the side effect and write <input-field-box> in any HTML. Attributes are kebab-case and always strings; the props table above names each one's attribute where it differs from its prop.