summaryrefslogtreecommitdiffhomepage
path: root/packages/ui/src/components/checkbox.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/ui/src/components/checkbox.tsx')
-rw-r--r--packages/ui/src/components/checkbox.tsx7
1 files changed, 3 insertions, 4 deletions
diff --git a/packages/ui/src/components/checkbox.tsx b/packages/ui/src/components/checkbox.tsx
index b98639758..7187e4ac3 100644
--- a/packages/ui/src/components/checkbox.tsx
+++ b/packages/ui/src/components/checkbox.tsx
@@ -1,5 +1,5 @@
import { Checkbox as Kobalte } from "@kobalte/core/checkbox"
-import { children, Show, splitProps } from "solid-js"
+import { Show, splitProps } from "solid-js"
import type { ComponentProps, JSX, ParentProps } from "solid-js"
export interface CheckboxProps extends ParentProps<ComponentProps<typeof Kobalte>> {
@@ -10,7 +10,6 @@ export interface CheckboxProps extends ParentProps<ComponentProps<typeof Kobalte
export function Checkbox(props: CheckboxProps) {
const [local, others] = splitProps(props, ["children", "class", "label", "hideLabel", "description", "icon"])
- const resolved = children(() => local.children)
return (
<Kobalte {...others} data-component="checkbox">
<Kobalte.Input data-slot="checkbox-checkbox-input" />
@@ -29,9 +28,9 @@ export function Checkbox(props: CheckboxProps) {
</Kobalte.Indicator>
</Kobalte.Control>
<div data-slot="checkbox-checkbox-content">
- <Show when={resolved()}>
+ <Show when={props.children}>
<Kobalte.Label data-slot="checkbox-checkbox-label" classList={{ "sr-only": local.hideLabel }}>
- {resolved()}
+ {props.children}
</Kobalte.Label>
</Show>
<Show when={local.description}>