Skip to main content

Skeletons.Entry

A text input field. The standard way to render a form input in Drumee. Autocomplete is disabled by default.


Signature

Skeletons.Entry(props, style?)

Common Props

PropTypeDescription
classNameStringCSS class(es) to apply
placeholderStringPlaceholder text shown when empty
valueStringInitial value
nameStringInput name attribute
sys_pnStringNamed part — enables onPartReady and ensurePart
uiHandlerWidgetRoutes interaction events to onUiEvent
errorHandlerWidgetRoutes validation error events
serviceStringService triggered on submit / commit
modeStringInteraction mode — e.g. "commit" to trigger service on Enter
requireStringValidation type — e.g. "email", "text"
formItemStringModel key this input is bound to in a form
innerClassStringCSS class applied to the inner input element
interactiveNumber1 to enable interactive mode
preselectNumber1 to select all text on focus
autocompleteStringAutocomplete behavior — defaults to "off"

Examples

Basic input with validation

Skeletons.Entry({
className: `${fig}__entry`,
placeholder: LOCALE.MY_PLACEHOLDER,
require: "email",
mode: "commit",
service: "my-submit",
sys_pn: "my-input",
uiHandler: ui,
});

Form-bound input with initial value

Skeletons.Entry({
className: `${fig}__entry`,
name: "my-field",
formItem: "my-field",
placeholder: LOCALE.MY_FIELD,
value: ui.mget("my-field") || "",
preselect: 1,
errorHandler: ui,
});

Reading the Input Value

Access the current value inside onUiEvent via cmd.mget or by reading the model form data:

case "my-submit":
const data = this.getData(_a.formItem);
const value = data["my-field"];
break;

Or read directly from a named part:

this.ensurePart("my-input").then((p) => {
const value = p.el.querySelector("input")?.value?.trim();
});