- Prop
label- Type
string | undefined- Default
- —
- Requirement
- optional
- Description
- Mono uppercase label rendered above field.
Docs Components Core
Input
React example follows below.
Vue example follows below.
Angular example follows below.
Svelte example follows below.
Solid example follows below.
- parts
- —
- nodes
- —
- size
- —
- part
- —
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> );}- parts
- —
- nodes
- —
- size
- —
- part
- —
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>- parts
- —
- nodes
- —
- size
- —
- part
- —
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;- parts
- —
- nodes
- —
- size
- —
- part
- —
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>- parts
- —
- nodes
- —
- size
- —
- part
- —
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
labelstring | undefined—
optional
Mono uppercase label rendered above field.
hintstring | undefined—
optional
Helper text below field.
errorstring | undefined—
optional
Error message — turns border + text crimson-error.
monoboolean | undefinedfalseoptional
Render value in JetBrains Mono (for IDs, tokens, code).
- 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
idstring | undefined—
optional
modelValuestring | number | undefined—
optional
defaultValuestring | number | undefined—
optional
disabledboolean | undefined—
optional
placeholderstring | undefined—
optional
typestring | undefined—
optional
requiredboolean | undefined—
optional
labelstring | undefined—
optional
hintstring | undefined—
optional
errorstring | undefined—
optional
monoboolean | 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
| Event | Payload |
|---|---|
update:modelValue | [value: string] |
Import
import { Component, signal } from "@angular/core";
import { GrassrootInput } from "@grassroot/ui-angular";
Props
Prop
Type
Default
Requirement
idstring—
optional
valuestring—
optional
defaultValuestring—
optional
typestring"text"optional
placeholderstring—
optional
disabledbooleanfalseoptional
readonlybooleanfalseoptional
requiredbooleanfalseoptional
namestring—
optional
autocompletestring—
optional
labelstring—
optional
hintstring—
optional
errorstring—
optional
monobooleanfalseoptional
- 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
| Event | Payload |
|---|---|
valueChange | string |
Import
import { Input } from "@grassroot/ui-svelte";
Props
Prop
Type
Default
Requirement
idstring—
optional
valuestring | number—
optional
disabledboolean—
optional
placeholderstring—
optional
typestring"text"optional
labelstring—
optional
hintstring—
optional
errorstring—
optional
monobooleanfalseoptional
classstring—
optional
classNamestring—
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
labelstring—
optional
hintstring—
optional
errorstring—
optional
monoboolean—
optional
classNamestring—
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.