Docs Components Core

Input

React example follows below.
ts
import { Input } from "@grassroot/ui-react";
import * as React from "react";
export default function InputDemo() {
const [name, setName] = React.useState("ledger-api");
return (
<div className="flex flex-col gap-3.5">
<Input
label="Service name"
hint="Lowercase, hyphen-separated."
value={name}
onChange={(e) => setName(e.target.value)}
/>
<Input label="Webhook URL" error="Must be a valid HTTPS URL." />
</div>
);
}
ts
<script setup lang="ts">
import { ref } from "vue";
import { Input } from "@grassroot/ui-vue";
const name = ref("ledger-api");
</script>
<template>
<div class="flex flex-col gap-3.5">
<Input v-model="name" label="Service name" hint="Lowercase, hyphen-separated." />
<Input label="Webhook URL" error="Must be a valid HTTPS URL." />
</div>
</template>
ts
import { Component, signal } from "@angular/core";
import { GrassrootInput } from "@grassroot/ui-angular";
@Component({
selector: "app-input-demo",
standalone: true,
imports: [GrassrootInput],
host: { style: "display: contents" },
template: `
<div class="flex flex-col gap-3.5">
<grassroot-input
label="Service name"
hint="Lowercase, hyphen-separated."
[value]="name()"
(valueChange)="name.set($event)"
/>
<grassroot-input label="Webhook URL" error="Must be a valid HTTPS URL." />
</div>
`,
})
export class InputDemoComponent {
readonly name = signal("ledger-api");
}
export default InputDemoComponent;
ts
<script lang="ts">
import { Input } from "@grassroot/ui-svelte";
let name = $state("ledger-api");
</script>
<div class="flex flex-col gap-3.5">
<Input
label="Service name"
hint="Lowercase, hyphen-separated."
value={name}
oninput={(event) => (name = event.currentTarget.value)}
/>
<Input label="Webhook URL" error="Must be a valid HTTPS URL." />
</div>
ts
/** @jsxImportSource solid-js */
import { createSignal } from "solid-js";
import { Input } from "@grassroot/ui-solid";
export default function InputDemo() {
const [name, setName] = createSignal("ledger-api");
return (
<div class="flex flex-col gap-3.5">
<Input
label="Service name"
hint="Lowercase, hyphen-separated."
value={name()}
onChange={(e) => setName(e.target.value)}
/>
<Input label="Webhook URL" error="Must be a valid HTTPS URL." />
</div>
);
}

Installation

API Reference

Import

import { Input } from "@grassroot/ui-react";
import * as React from "react";

Props

Prop
Type
Default
Requirement
Description
label
string | undefined
—
optional
Mono uppercase label rendered above field.
hint
string | undefined
—
optional
Helper text below field.
error
string | undefined
—
optional
Error message — turns border + text crimson-error.
mono
boolean | undefined
false
optional
Render value in JetBrains Mono (for IDs, tokens, code).
Prop
label
Type
string | undefined
Default
—
Requirement
optional
Description
Mono uppercase label rendered above field.
Prop
hint
Type
string | undefined
Default
—
Requirement
optional
Description
Helper text below field.
Prop
error
Type
string | undefined
Default
—
Requirement
optional
Description
Error message — turns border + text crimson-error.
Prop
mono
Type
boolean | undefined
Default
false
Requirement
optional
Description
Render value in JetBrains Mono (for IDs, tokens, code).

Native attributes

Standard DOM and ARIA attributes not listed above spread onto the root element.

Import

import { ref } from "vue";
import { Input } from "@grassroot/ui-vue";

Props

Prop
Type
Default
Requirement
id
string | undefined
—
optional
modelValue
string | number | undefined
—
optional
defaultValue
string | number | undefined
—
optional
disabled
boolean | undefined
—
optional
placeholder
string | undefined
—
optional
type
string | undefined
—
optional
required
boolean | undefined
—
optional
label
string | undefined
—
optional
hint
string | undefined
—
optional
error
string | undefined
—
optional
mono
boolean | undefined
—
optional
Prop
id
Type
string | undefined
Default
—
Requirement
optional
Prop
modelValue
Type
string | number | undefined
Default
—
Requirement
optional
Prop
defaultValue
Type
string | number | undefined
Default
—
Requirement
optional
Prop
disabled
Type
boolean | undefined
Default
—
Requirement
optional
Prop
placeholder
Type
string | undefined
Default
—
Requirement
optional
Prop
type
Type
string | undefined
Default
—
Requirement
optional
Prop
required
Type
boolean | undefined
Default
—
Requirement
optional
Prop
label
Type
string | undefined
Default
—
Requirement
optional
Prop
hint
Type
string | undefined
Default
—
Requirement
optional
Prop
error
Type
string | undefined
Default
—
Requirement
optional
Prop
mono
Type
boolean | undefined
Default
—
Requirement
optional

Events

EventPayload
update:modelValue[value: string]

Import

import { Component, signal } from "@angular/core";
import { GrassrootInput } from "@grassroot/ui-angular";

Props

Prop
Type
Default
Requirement
id
string
—
optional
value
string
—
optional
defaultValue
string
—
optional
type
string
"text"
optional
placeholder
string
—
optional
disabled
boolean
false
optional
readonly
boolean
false
optional
required
boolean
false
optional
name
string
—
optional
autocomplete
string
—
optional
label
string
—
optional
hint
string
—
optional
error
string
—
optional
mono
boolean
false
optional
Prop
id
Type
string
Default
—
Requirement
optional
Prop
value
Type
string
Default
—
Requirement
optional
Prop
defaultValue
Type
string
Default
—
Requirement
optional
Prop
type
Type
string
Default
"text"
Requirement
optional
Prop
placeholder
Type
string
Default
—
Requirement
optional
Prop
disabled
Type
boolean
Default
false
Requirement
optional
Prop
readonly
Type
boolean
Default
false
Requirement
optional
Prop
required
Type
boolean
Default
false
Requirement
optional
Prop
name
Type
string
Default
—
Requirement
optional
Prop
autocomplete
Type
string
Default
—
Requirement
optional
Prop
label
Type
string
Default
—
Requirement
optional
Prop
hint
Type
string
Default
—
Requirement
optional
Prop
error
Type
string
Default
—
Requirement
optional
Prop
mono
Type
boolean
Default
false
Requirement
optional
Prop
"aria-label"
Type
string
Default
undefined
Requirement
optional

Events

EventPayload
valueChangestring

Import

import { Input } from "@grassroot/ui-svelte";

Props

Prop
Type
Default
Requirement
id
string
—
optional
value
string | number
—
optional
disabled
boolean
—
optional
placeholder
string
—
optional
type
string
"text"
optional
label
string
—
optional
hint
string
—
optional
error
string
—
optional
mono
boolean
false
optional
class
string
—
optional
className
string
—
optional
Prop
id
Type
string
Default
—
Requirement
optional
Prop
value
Type
string | number
Default
—
Requirement
optional
Prop
disabled
Type
boolean
Default
—
Requirement
optional
Prop
placeholder
Type
string
Default
—
Requirement
optional
Prop
type
Type
string
Default
"text"
Requirement
optional
Prop
label
Type
string
Default
—
Requirement
optional
Prop
hint
Type
string
Default
—
Requirement
optional
Prop
error
Type
string
Default
—
Requirement
optional
Prop
mono
Type
boolean
Default
false
Requirement
optional
Prop
class
Type
string
Default
—
Requirement
optional
Prop
className
Type
string
Default
—
Requirement
optional

Import

import { createSignal } from "solid-js";
import { Input } from "@grassroot/ui-solid";

Props

Prop
Type
Default
Requirement
label
string
—
optional
hint
string
—
optional
error
string
—
optional
mono
boolean
—
optional
className
string
—
optional
Prop
label
Type
string
Default
—
Requirement
optional
Prop
hint
Type
string
Default
—
Requirement
optional
Prop
error
Type
string
Default
—
Requirement
optional
Prop
mono
Type
boolean
Default
—
Requirement
optional
Prop
className
Type
string
Default
—
Requirement
optional

Native attributes

Standard DOM and ARIA attributes not listed above spread onto the root element.