Docs / Components / Input
ven.js
Input
venjs.input(props) — a labeled text field. Returns a wrapper div containing an optional label and the input element.
Signature
venjs.input(props) → VNode
Props
| Prop | Type | Description |
|---|---|---|
label | string | When present, a label is rendered above the field. |
class | string | Appended to the input element’s classes. |
| any input attribute / event | — | type, placeholder, value, oninput, etc. are forwarded to the inner input. |
Example
const email = venjs.signal("");
venjs.input({
label: "Email",
type: "email",
placeholder: "you@example.com",
value: email.value,
oninput: (e) => (email.value = e.target.value)
});
The wrapper is
flex flex-col gap-1 w-full and the input gets focus-ring utility classes. The class prop you pass is applied to the input, not the wrapper.