diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/astro.config.mjs b/astro.config.mjs
index 82ca5f0..08f15ea 100644
--- a/astro.config.mjs
+++ b/astro.config.mjs
@@ -1,36 +1,54 @@
-import { defineConfig } from 'astro/config';
+import {defineConfig} from 'astro/config';
import starlight from '@astrojs/starlight';
import expressiveCode from "astro-expressive-code";
// https://astro.build/config
export default defineConfig({
- site: 'https://withastro-utils.github.io',
- base: '/docs',
- integrations: [expressiveCode(), starlight({
- editLink: {
- baseUrl: 'https://github.com/withastro-utils/docs/tree/main/',
- },
- lastUpdated: true,
- favicon: '/favicon.png',
- title: 'Astro Utils',
- logo: {
- src: '/src/assets/logo.png'
- },
- social: {
- github: 'https://github.com/withastro-utils/utils'
- },
- sidebar: [{
- label: 'Guides',
- autogenerate: {
- directory: 'guides'
- }
- }, {
- label: 'Reference',
- autogenerate: {
- directory: 'reference'
- }
- }],
- customCss: ['./src/styles/home.css', './src/styles/code-margin.css']
- })]
+ site: 'https://withastro-utils.github.io',
+ base: '/docs',
+ integrations: [expressiveCode(), starlight({
+ editLink: {
+ baseUrl: 'https://github.com/withastro-utils/docs/tree/main/',
+ },
+ lastUpdated: true,
+ favicon: '/favicon.png',
+ title: 'Astro Utils',
+ logo: {
+ src: '/src/assets/logo.png'
+ },
+ social: {
+ github: 'https://github.com/withastro-utils/utils'
+ },
+ sidebar: [{
+ label: 'Guides',
+ items: [{
+ label: 'Forms',
+ items: [
+ {
+ label: 'Getting Started',
+ link: '/guides/forms/getting-started'
+ }, {
+ label: 'Data Binding',
+ link: '/guides/forms/data-binding'
+ }, {
+ label: 'JS Helpers',
+ link: '/guides/forms/js-helpers'
+ }
+ ]
+ }, {
+ label: 'Context',
+ link: '/guides/context'
+ }, {
+ label: 'Express Endpoints',
+ link: '/guides/express-endpoints'
+ }]
+ }, {
+ label: 'Reference',
+ autogenerate: {
+ directory: 'reference/forms'
+ }
+ }],
+ customCss: ['./src/styles/home.css', './src/styles/code-margin.css']
+ })]
});
diff --git a/src/assets/change-color/after-clicks.png b/src/assets/change-color/after-clicks.png
new file mode 100644
index 0000000..36bcefe
Binary files /dev/null and b/src/assets/change-color/after-clicks.png differ
diff --git a/src/assets/change-color/initial-state.png b/src/assets/change-color/initial-state.png
new file mode 100644
index 0000000..125fc20
Binary files /dev/null and b/src/assets/change-color/initial-state.png differ
diff --git a/src/content/docs/reference/context.mdx b/src/content/docs/guides/context.mdx
similarity index 100%
rename from src/content/docs/reference/context.mdx
rename to src/content/docs/guides/context.mdx
diff --git a/src/content/docs/guides/forms/data-binding.mdx b/src/content/docs/guides/forms/data-binding.mdx
new file mode 100644
index 0000000..ea1d0ea
--- /dev/null
+++ b/src/content/docs/guides/forms/data-binding.mdx
@@ -0,0 +1,145 @@
+---
+title: Binding & Validation
+description: Using data binding with Astro Forms
+---
+
+# Introduction
+
+With Astro Forms you can easily create forms with data binding and validation. It also provides a simple way to handle form submissions and preserve state between postbacks.
+
+## Data Binding
+
+Astro Forms supports two-way data binding. This means that you can bind a form field to a property on `Bind` instance and the value of the property will be updated when the field changes and vice versa.
+
+### Example
+
+```astro
+---
+import { Bind, BindForm, BButton, BInput } from "@astro-utils/forms/forms.js";
+import Layout from "../layouts/Layout.astro";
+
+type Form = {
+ name: string;
+ age: number;
+}
+
+const form = Bind