MCPcopy Create free account
hub / github.com/kobaltedev/kobalte / ErrorMessageExample

Function ErrorMessageExample

apps/docs/src/examples/text-field.tsx:84–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

82}
83
84export function ErrorMessageExample() {
85 const [value, setValue] = createSignal("Orange");
86
87 return (
88 <TextField
89 class={style["text-field"]}
90 value={value()}
91 onChange={setValue}
92 validationState={value() !== "Apple" ? "invalid" : "valid"}
93 >
94 <TextField.Label class={style["text-field__label"]}>
95 Favorite fruit
96 </TextField.Label>
97 <TextField.Input class={style["text-field__input"]} />
98 <TextField.ErrorMessage class={style["text-field__error-message"]}>
99 Hmm, I prefer apples.
100 </TextField.ErrorMessage>
101 </TextField>
102 );
103}
104
105export function HTMLFormExample() {
106 let formRef: HTMLFormElement | undefined;

Callers

nothing calls this directly

Calls 1

valueFunction · 0.50

Tested by

no test coverage detected