diff --git a/apps/demo/src/components/Layout.astro b/apps/demo/src/components/Layout.astro
new file mode 100644
index 0000000..3a01966
--- /dev/null
+++ b/apps/demo/src/components/Layout.astro
@@ -0,0 +1,30 @@
+---
+import Nav from "./Nav.astro";
+
+export interface Props {
+ title: string;
+ theme?: "dark" | "light";
+}
+const { theme = "light", title } = Astro.props;
+---
+
+
+
+
+
+
+
+ {title} | Astro Reactive Demo
+
+
+
+ {title}
+
+
+
+
diff --git a/apps/demo/src/pages/examples/form-component.astro b/apps/demo/src/pages/examples/form-component.astro
index 69c1a9b..30428b1 100644
--- a/apps/demo/src/pages/examples/form-component.astro
+++ b/apps/demo/src/pages/examples/form-component.astro
@@ -1,6 +1,7 @@
---
import type { Submit } from "@astro-reactive/common";
import Form, { FormGroup } from "@astro-reactive/form";
+import Layout from "../../components/Layout.astro";
const simpleForm = new FormGroup([
{
@@ -75,8 +76,10 @@ const submitControl: Submit = {
};
---
-Simple Form
-
+
+ Simple Form
+
-Form with nested form groups
-
+ Form with nested form groups
+
+
diff --git a/apps/demo/src/pages/examples/index.astro b/apps/demo/src/pages/examples/index.astro
index 81a1096..db32788 100644
--- a/apps/demo/src/pages/examples/index.astro
+++ b/apps/demo/src/pages/examples/index.astro
@@ -1,7 +1,9 @@
---
+import Layout from "../../components/Layout.astro";
---
-Docs Examples
-
+
+
+
diff --git a/apps/demo/src/pages/index.astro b/apps/demo/src/pages/index.astro
index 488a307..64fd430 100644
--- a/apps/demo/src/pages/index.astro
+++ b/apps/demo/src/pages/index.astro
@@ -1,11 +1,11 @@
---
-import Nav from "../components/Nav.astro";
import Form, {
ControlConfig,
FormGroup,
FormControl,
} from "@astro-reactive/form";
import { Validators } from "@astro-reactive/validator";
+import Layout from "../components/Layout.astro";
const form = new FormGroup([
{
@@ -86,26 +86,10 @@ form.get("is-awesome")?.setValue("checked");
form.get("email")?.setValue("invalid-email");
// switch between light and dark mode
+const title = "Form Demo";
const theme = "dark";
---
-
-
-
-
-
-
- Astro
-
-
-
- Astro Reactive Form
-
-
-
-
+
+
+
diff --git a/apps/demo/src/pages/job-application.astro b/apps/demo/src/pages/job-application.astro
index 93033b1..a371884 100644
--- a/apps/demo/src/pages/job-application.astro
+++ b/apps/demo/src/pages/job-application.astro
@@ -1,5 +1,4 @@
---
-import Nav from "../components/Nav.astro";
import Form, {
ControlConfig,
FormControl,
@@ -7,6 +6,7 @@ import Form, {
} from "@astro-reactive/form";
import { Validators } from "@astro-reactive/validator";
import type { Submit } from "@astro-reactive/common";
+import Layout from "../components/Layout.astro";
const infoForm = new FormGroup([
{
@@ -106,8 +106,8 @@ const values = {
lastName: "Bond",
email: "james.bond@gmail.com",
country: "U.S.A",
- eligible: "yes"
-}
+ eligible: "yes",
+};
infoForm.setValue(values);
@@ -117,50 +117,10 @@ skillsForm.name = "Skills";
skillsForm.controls.push(new FormControl(resume));
---
-
-
-
-
-
-
- Astro
-
-
-
-
-
-
- Programmer Job Application
-
-
-
-
-
-
-
-
-
- Enter your information
-
-
-
-
-
-
-
-
-
-
+
+
+
diff --git a/apps/demo/src/pages/pizza-delivery.astro b/apps/demo/src/pages/pizza-delivery.astro
index af48a83..6f857ea 100644
--- a/apps/demo/src/pages/pizza-delivery.astro
+++ b/apps/demo/src/pages/pizza-delivery.astro
@@ -1,7 +1,7 @@
---
-import Nav from "../components/Nav.astro";
import Form, { FormGroup } from "@astro-reactive/form";
import { Validators } from "@astro-reactive/validator";
+import Layout from "../components/Layout.astro";
const baseForm = new FormGroup([
{
@@ -91,20 +91,9 @@ infoForm.name = "Customer Info";
infoForm.get("contact")?.setValidators([Validators.minLength(9)]);
---
-
-
-
-
-
-
- Astro
-
-
-
- Pizza Form Demo
-
-
-
+
+
+