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

Function ErrorMessageExample

apps/docs/src/examples/switch.tsx:66–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64}
65
66export function ErrorMessageExample() {
67 const [checked, setChecked] = createSignal(false);
68
69 return (
70 <Switch
71 class={style.switch}
72 checked={checked()}
73 onChange={setChecked}
74 validationState={!checked() ? "invalid" : "valid"}
75 >
76 <div class="flex flex-col items-start mr-2">
77 <Switch.Label class={style.switch__label}>Airplane mode</Switch.Label>
78 <Switch.ErrorMessage class={style["switch__error-message"]}>
79 You must enable airplane mode.
80 </Switch.ErrorMessage>
81 </div>
82 <Switch.Input class={style.switch__input} />
83 <Switch.Control class={style.switch__control}>
84 <Switch.Thumb class={style.switch__thumb} />
85 </Switch.Control>
86 </Switch>
87 );
88}
89
90export function HTMLFormExample() {
91 let formRef: HTMLFormElement | undefined;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected