Text
A single-line string input for generic text, with placeholders, trimming, and well-defined commit semantics.
Text is ParamPanel's single-line string value control for generic text — titles, labels, filenames, arbitrary short strings. For numeric values, use Number. For multi-line strings, see Textarea.
Try it
Usage
const title = pp.text({
label: "Title",
value: "Demo",
});Configuration
interface TextConfig extends BaseControlConfig {
value: string;
placeholder?: string;
/** Trim whitespace on final commit. Defaults to false. */
trim?: boolean;
}
interface TextControl extends ValueControl<string, TextConfig> {}title.configure({
placeholder: "Enter a title",
trim: true,
});Input semantics
Text inputs follow a consistent intermediate/final model:
- Typing emits
final: falseon each keystroke. - Blur or Enter emits
final: true. - Escape may restore the pre-edit value.
- IME composition is handled correctly, so composed characters do not fire premature events.
This means you can drive a live preview from intermediate events and commit
expensive work only on final:
title.subscribe((value, details) => {
preview.textContent = value;
if (details.final) saveTitle(value);
});