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

Function ErrorMessageExample

apps/docs/src/examples/checkbox.tsx:80–104  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

78}
79
80export function ErrorMessageExample() {
81 const [checked, setChecked] = createSignal(false);
82
83 return (
84 <Checkbox
85 class={clsx(style.checkbox, "!items-start")}
86 checked={checked()}
87 onChange={setChecked}
88 validationState={!checked() ? "invalid" : "valid"}
89 >
90 <Checkbox.Input class={style.checkbox__input} />
91 <Checkbox.Control class={style.checkbox__control}>
92 <Checkbox.Indicator>
93 <CheckIcon />
94 </Checkbox.Indicator>
95 </Checkbox.Control>
96 <div class="flex flex-col items-start -mt-0.5">
97 <Checkbox.Label class={style.checkbox__label}>Subscribe</Checkbox.Label>
98 <Checkbox.ErrorMessage class={style["checkbox__error-message"]}>
99 You must agree to our Terms and Conditions.
100 </Checkbox.ErrorMessage>
101 </div>
102 </Checkbox>
103 );
104}
105
106export function HTMLFormExample() {
107 let formRef: HTMLFormElement | undefined;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected