From 3ff6f60638f0e535eecb259846ea9e405effcc82 Mon Sep 17 00:00:00 2001 From: Nikhil M Warrier Date: Sun, 15 Mar 2026 12:41:11 +0530 Subject: Add `select`, `radio`, `checkbox` to forms --- src/components/FormField.astro | 76 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 src/components/FormField.astro (limited to 'src/components/FormField.astro') diff --git a/src/components/FormField.astro b/src/components/FormField.astro new file mode 100644 index 0000000..f03403d --- /dev/null +++ b/src/components/FormField.astro @@ -0,0 +1,76 @@ +--- +import type { CollectionEntry } from 'astro:content' + +interface Props { + field: CollectionEntry<'forms'>['data']['form']['fields'][number] +} + +const field = Astro.props.field +const fieldType = field.type as astroHTML.JSX.HTMLInputTypeAttribute +--- + +
+ + + { + () => { + switch (field.type) { + case 'textarea': + return ( +