MCPcopy Create free account
hub / github.com/arctic-cli/interface / Checkbox

Function Checkbox

packages/ui/src/components/checkbox.tsx:11–44  ·  view source on GitHub ↗
(props: CheckboxProps)

Source from the content-addressed store, hash-verified

9}
10
11export function Checkbox(props: CheckboxProps) {
12 const [local, others] = splitProps(props, ["children", "class", "label", "hideLabel", "description", "icon"])
13 const resolved = children(() => local.children)
14 return (
15 <Kobalte {...others} data-component="checkbox">
16 <Kobalte.Input data-slot="checkbox-checkbox-input" />
17 <Kobalte.Control data-slot="checkbox-checkbox-control">
18 <Kobalte.Indicator data-slot="checkbox-checkbox-indicator">
19 {local.icon || (
20 <svg viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
21 <path
22 d="M3 7.17905L5.02703 8.85135L9 3.5"
23 stroke="currentColor"
24 stroke-width="1.5"
25 stroke-linecap="square"
26 />
27 </svg>
28 )}
29 </Kobalte.Indicator>
30 </Kobalte.Control>
31 <div data-slot="checkbox-checkbox-content">
32 <Show when={resolved()}>
33 <Kobalte.Label data-slot="checkbox-checkbox-label" classList={{ "sr-only": local.hideLabel }}>
34 {resolved()}
35 </Kobalte.Label>
36 </Show>
37 <Show when={local.description}>
38 <Kobalte.Description data-slot="checkbox-checkbox-description">{local.description}</Kobalte.Description>
39 </Show>
40 <Kobalte.ErrorMessage data-slot="checkbox-checkbox-error" />
41 </div>
42 </Kobalte>
43 )
44}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected