Skip to main content

kozan_core/html/
html_form_element.rs

1//! `HTMLFormElement` — a form container.
2//!
3//! Chrome equivalent: `HTMLFormElement`.
4//! Groups form controls for submission.
5
6use crate::Handle;
7use kozan_macros::{Element, Props};
8
9/// A form element (`<form>`).
10///
11/// Chrome equivalent: `HTMLFormElement`.
12#[derive(Copy, Clone, Element)]
13#[element(tag = "form", data = FormData)]
14pub struct HtmlFormElement(Handle);
15
16/// Element-specific data for `<form>`.
17#[derive(Default, Clone, Props)]
18#[props(element = HtmlFormElement)]
19pub struct FormData {
20    /// The URL to submit the form to.
21    #[prop]
22    pub action: String,
23    /// The HTTP method ("get" or "post").
24    #[prop]
25    pub method: String,
26}