Input
A native input element that automatically works with Field.
<?phem
use Phem\Attribute\Component;
use Phem\Node;
use Phem\Ui\Input;
#[Component]
function InputHeroDemo(): Node
{
return (
<label className="flex flex-col items-start gap-1 text-sm font-bold text-neutral-950 dark:text-white">
Name
<Input placeholder="e.g. Colm Tuite" />
</label>
);
}
API reference#
Import the components of the family:
use function Phem\Ui\Input;Input#
A native text input: Base UI Input. In a Field, it is the control of the field. Bind it to a state of the app with phem:bind, or give its first value in defaultValue.
| Prop | Type | Default |
|---|---|---|
value | ?Bound | null |
defaultValue | ?string | null |
disabled | bool | false |
...rest | mixed | — |
The source of the examples: examples/ui/Input.phem.