Input class
<input> — interactive form input control element.
Void element: <input> cannot have children and is emitted without a closing tag.
Reactivity Pattern
Setting value configures the initial HTML attribute. For two-way data binding,
listen with onInput or onChange and update a Signal:
final query = signal('');
BloomNode searchInput() => Input(
placeholder: 'Search items...',
value: query.value,
onInput: (e) => query.value = (e.target as dynamic).value,
);
Constructors
-
Input({String? className, String? style, Map<
String, String> ? attrs, String? placeholder, String? value, String? type, bool? checked, bool? disabled, String? name, Map<String, BloomEventHandler> ? on, BloomEventHandler? onInput, BloomEventHandler? onChange, BloomEventHandler? onClick, BloomEventHandler? onKeyDown, BloomEventHandler? onKeyUp, BloomEventHandler? onKeyPress, BloomEventHandler? onFocus, BloomEventHandler? onBlur}) -
Creates an
<input>element descriptor with attribute and event shorthands. -
Input.raw({String? className, String? style, Map<
String, String> ? attrs, Map<String, BloomEventHandler> ? on}) -
Const constructor for
<input>without attribute and event shorthands.const
Properties
-
attrs
→ Map<
String, String> ? -
Arbitrary HTML attributes (id, href, placeholder, etc.).
finalinherited
-
children
→ List<
BloomNode> -
Child descriptors nested within this element.
finalinherited
- className → String?
-
CSS class attribute applied to the element.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
on
→ Map<
String, BloomEventHandler> ? -
Event handlers keyed by DOM event name (click, input, change...).
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- style → String?
-
Inline style — raw CSS string (e.g. "color: red; display: flex;").
finalinherited
- tag → String
-
Lowercase tag name, e.g. "div", "button", "custom-tag".
finalinherited
- text → String?
-
Optional single text child sugar — equivalent to
children: [Text(text)]when no explicit children are given.finalinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited