@tempots/dom

input variable

A convenience object to create Renderables for HTMLInput elements.

It automatically creates an attribute with the specified type

Signature:

input: {
    number: (...children: TNode[]) => Renderable;
    text: (...children: TNode[]) => Renderable;
    color: (...children: TNode[]) => Renderable;
    image: (...children: TNode[]) => Renderable;
    button: (...children: TNode[]) => Renderable;
    search: (...children: TNode[]) => Renderable;
    time: (...children: TNode[]) => Renderable;
    checkbox: (...children: TNode[]) => Renderable;
    radio: (...children: TNode[]) => Renderable;
    file: (...children: TNode[]) => Renderable;
    password: (...children: TNode[]) => Renderable;
    submit: (...children: TNode[]) => Renderable;
    reset: (...children: TNode[]) => Renderable;
    date: (...children: TNode[]) => Renderable;
    range: (...children: TNode[]) => Renderable;
    hidden: (...children: TNode[]) => Renderable;
    month: (...children: TNode[]) => Renderable;
    week: (...children: TNode[]) => Renderable;
    email: (...children: TNode[]) => Renderable;
    tel: (...children: TNode[]) => Renderable;
    url: (...children: TNode[]) => Renderable;
    "datetime-local": (...children: TNode[]) => Renderable;
}

Example

input.text() // equivalent to html.input(attr.type('text'))