diff --git a/package.json b/package.json
index d65a958..f3888b3 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
},
"devDependencies": {
"@emotion/react": "^11.11.1",
- "@form-atoms/field": "^4.0.0",
+ "@form-atoms/field": "^4.0.7",
"@mdx-js/react": "^2.3.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^11.1.0",
diff --git a/src/components/checkbox-field/CheckboxField.stories.tsx b/src/components/checkbox-field/CheckboxField.stories.tsx
index b340d91..d2d5211 100644
--- a/src/components/checkbox-field/CheckboxField.stories.tsx
+++ b/src/components/checkbox-field/CheckboxField.stories.tsx
@@ -39,3 +39,20 @@ export const Optional: FormStory = {
),
},
};
+
+const imGoing = checkboxField();
+
+export const Initialized: FormStory = {
+ ...optionalField,
+ args: {
+ fields: { imGoing },
+ children: () => (
+
+ ),
+ },
+};
diff --git a/src/components/checkbox-field/CheckboxField.tsx b/src/components/checkbox-field/CheckboxField.tsx
index b613f0c..a989078 100644
--- a/src/components/checkbox-field/CheckboxField.tsx
+++ b/src/components/checkbox-field/CheckboxField.tsx
@@ -1,5 +1,6 @@
import { CheckboxFieldProps, useCheckboxFieldProps } from "@form-atoms/field";
import { Checkbox, CheckboxProps, HelperText, Label } from "flowbite-react";
+import { ReactNode } from "react";
import { useFieldError } from "../../hooks";
@@ -7,9 +8,10 @@ export const CheckboxField = ({
field,
label,
helperText,
+ initialValue,
...uiProps
-}: CheckboxFieldProps & CheckboxProps) => {
- const props = useCheckboxFieldProps(field);
+}: CheckboxFieldProps & CheckboxProps & { helperText?: ReactNode }) => {
+ const props = useCheckboxFieldProps(field, { initialValue });
const { color, error } = useFieldError(field);
const help = error ?? helperText;
diff --git a/src/components/checkbox-group-field/CheckboxGroupField.stories.tsx b/src/components/checkbox-group-field/CheckboxGroupField.stories.tsx
index 15a918a..913e5af 100644
--- a/src/components/checkbox-group-field/CheckboxGroupField.stories.tsx
+++ b/src/components/checkbox-group-field/CheckboxGroupField.stories.tsx
@@ -44,3 +44,22 @@ export const Optional: FormStory = {
),
},
};
+
+const langs = stringArrayField();
+
+export const Initialized: FormStory = {
+ ...optionalField,
+ args: {
+ fields: { langs },
+ children: () => (
+
+ ),
+ },
+};
diff --git a/src/components/checkbox-group-field/CheckboxGroupField.tsx b/src/components/checkbox-group-field/CheckboxGroupField.tsx
index 23d7b90..5fb6492 100644
--- a/src/components/checkbox-group-field/CheckboxGroupField.tsx
+++ b/src/components/checkbox-group-field/CheckboxGroupField.tsx
@@ -1,5 +1,4 @@
import {
- FieldProps,
UseCheckboxGroupProps,
ZodArrayField,
useCheckboxGroup,
@@ -7,7 +6,14 @@ import {
import { Checkbox, HelperText, Label } from "flowbite-react";
import { Option as BaseOption, type OptionRenderProp } from "../";
-import { FlowbiteField } from "../field";
+import { FlowbiteField, type FlowbiteFieldProps } from "../field";
+
+export type CheckboxGroupFieldProps<
+ Option,
+ Field extends ZodArrayField,
+> = FlowbiteFieldProps &
+ UseCheckboxGroupProps