pub struct FormBuilder<FD: FormToolData> { /* private fields */ }Expand description
A builder for laying out forms.
This builder allows you to specify what components should make up the form.
Implementations§
Source§impl<FD: FormToolData> FormBuilder<FD>
impl<FD: FormToolData> FormBuilder<FD>
Builds a button and adds it to the form.
Builds a button using the form’s context and adds it to the form.
Source§impl<FD: FormToolData> FormBuilder<FD>
impl<FD: FormToolData> FormBuilder<FD>
Sourcepub fn checkbox<FDT: Clone + PartialEq + 'static>(
self,
builder: impl BuilderFn<ControlBuilder<FD, CheckboxData, FDT>>,
) -> Self
pub fn checkbox<FDT: Clone + PartialEq + 'static>( self, builder: impl BuilderFn<ControlBuilder<FD, CheckboxData, FDT>>, ) -> Self
Builds a checkbox and adds it to the form.
Sourcepub fn checkbox_cx<FDT: Clone + PartialEq + 'static>(
self,
builder: impl BuilderCxFn<ControlBuilder<FD, CheckboxData, FDT>, FD::Context>,
) -> Self
pub fn checkbox_cx<FDT: Clone + PartialEq + 'static>( self, builder: impl BuilderCxFn<ControlBuilder<FD, CheckboxData, FDT>, FD::Context>, ) -> Self
Builds a checkbox using the form’s context and adds it to the form.
Source§impl<FD: FormToolData> FormBuilder<FD>
impl<FD: FormToolData> FormBuilder<FD>
Sourcepub fn custom<CC: ControlData<FD>, FDT: Clone + PartialEq + 'static>(
self,
control_data: CC,
builder: impl BuilderFn<ControlBuilder<FD, CC, FDT>>,
) -> Self
pub fn custom<CC: ControlData<FD>, FDT: Clone + PartialEq + 'static>( self, control_data: CC, builder: impl BuilderFn<ControlBuilder<FD, CC, FDT>>, ) -> Self
Builds a custom component and adds it to the form.
Sourcepub fn custom_cx<CC: ControlData<FD>, FDT: Clone + PartialEq + 'static>(
self,
control_data: CC,
builder: impl BuilderCxFn<ControlBuilder<FD, CC, FDT>, FD::Context>,
) -> Self
pub fn custom_cx<CC: ControlData<FD>, FDT: Clone + PartialEq + 'static>( self, control_data: CC, builder: impl BuilderCxFn<ControlBuilder<FD, CC, FDT>, FD::Context>, ) -> Self
Builds a custom component using the form’s context and adds it to the form.
Sourcepub fn custom_vanity<CC: VanityControlData<FD>>(
self,
control_data: CC,
builder: impl BuilderFn<VanityControlBuilder<FD, CC>>,
) -> Self
pub fn custom_vanity<CC: VanityControlData<FD>>( self, control_data: CC, builder: impl BuilderFn<VanityControlBuilder<FD, CC>>, ) -> Self
Builds a custom vanity component and adds it to the form.
Sourcepub fn custom_vanity_cx<CC: VanityControlData<FD>>(
self,
control_data: CC,
builder: impl BuilderCxFn<VanityControlBuilder<FD, CC>, FD::Context>,
) -> Self
pub fn custom_vanity_cx<CC: VanityControlData<FD>>( self, control_data: CC, builder: impl BuilderCxFn<VanityControlBuilder<FD, CC>, FD::Context>, ) -> Self
Builds a custom vanity component using the form’s context and adds it to the form.
Sourcepub fn raw_view(
self,
render_fn: impl Fn(Arc<FD::Style>, RwSignal<FD>, Arc<FD::Context>) -> AnyView + 'static,
) -> Self
pub fn raw_view( self, render_fn: impl Fn(Arc<FD::Style>, RwSignal<FD>, Arc<FD::Context>) -> AnyView + 'static, ) -> Self
Add a raw view to the form.
This gives you access to everything you might need when rendering a read-only view.
This can be helpful for rendering a custom visual component, but is often times not needed.
This method does not give you any access to the validation system so you should not add controls to the form with this method. consider defining a custom component for this purpose.
Source§impl<FD: FormToolData> FormBuilder<FD>
impl<FD: FormToolData> FormBuilder<FD>
Sourcepub fn group(self, builder: impl Fn(FormBuilder<FD>) -> FormBuilder<FD>) -> Self
pub fn group(self, builder: impl Fn(FormBuilder<FD>) -> FormBuilder<FD>) -> Self
Creates a form group.
This creates a subsection of the form that controls can be added to like a normal form.
Source§impl<FD: FormToolData> FormBuilder<FD>
impl<FD: FormToolData> FormBuilder<FD>
Sourcepub fn heading(
self,
builder: impl BuilderFn<VanityControlBuilder<FD, HeadingData>>,
) -> Self
pub fn heading( self, builder: impl BuilderFn<VanityControlBuilder<FD, HeadingData>>, ) -> Self
Builds a heading and adds it to the form.
Sourcepub fn heading_cx(
self,
builder: impl BuilderCxFn<VanityControlBuilder<FD, HeadingData>, FD::Context>,
) -> Self
pub fn heading_cx( self, builder: impl BuilderCxFn<VanityControlBuilder<FD, HeadingData>, FD::Context>, ) -> Self
Builds a hehading using the form’s context and adds it to the form.
Source§impl<FD: FormToolData> FormBuilder<FD>
impl<FD: FormToolData> FormBuilder<FD>
Builds a hidden form control and adds it to the form.
This will be an input in the html form allowing you to insert some data the you might not want the user modifying.
Builds a hidden form control using the form’s context and adds it to the form.
This will be an input in the html form allowing you to insert some data the you might not want the user modifying.
Source§impl<FD: FormToolData> FormBuilder<FD>
impl<FD: FormToolData> FormBuilder<FD>
Sourcepub fn output(
self,
builder: impl BuilderFn<VanityControlBuilder<FD, OutputData>>,
) -> Self
pub fn output( self, builder: impl BuilderFn<VanityControlBuilder<FD, OutputData>>, ) -> Self
Builds an output form control and adds it to the form.
This control allows you to output some text to the user based on the form data.
Sourcepub fn output_cx(
self,
builder: impl BuilderCxFn<VanityControlBuilder<FD, OutputData>, FD::Context>,
) -> Self
pub fn output_cx( self, builder: impl BuilderCxFn<VanityControlBuilder<FD, OutputData>, FD::Context>, ) -> Self
Builds an output form control using the form’s context and adds it to the form.
This control allows you to output some text to the user based on the form data and form context.
Source§impl<FD: FormToolData> FormBuilder<FD>
impl<FD: FormToolData> FormBuilder<FD>
Builds a radio buttons control and adds it to the form.
Builds a radio buttons control using the form’s context and adds it to the form.
Source§impl<FD: FormToolData> FormBuilder<FD>
impl<FD: FormToolData> FormBuilder<FD>
Sourcepub fn select<FDT: Clone + PartialEq + 'static>(
self,
builder: impl BuilderFn<ControlBuilder<FD, SelectBuildData<FD>, FDT>>,
) -> Self
pub fn select<FDT: Clone + PartialEq + 'static>( self, builder: impl BuilderFn<ControlBuilder<FD, SelectBuildData<FD>, FDT>>, ) -> Self
Builds a select control and adds it to the form.
Sourcepub fn select_cx<FDT: Clone + PartialEq + 'static>(
self,
builder: impl BuilderCxFn<ControlBuilder<FD, SelectBuildData<FD>, FDT>, FD::Context>,
) -> Self
pub fn select_cx<FDT: Clone + PartialEq + 'static>( self, builder: impl BuilderCxFn<ControlBuilder<FD, SelectBuildData<FD>, FDT>, FD::Context>, ) -> Self
Builds a select control using the form’s context and adds it to the form.
Source§impl<FD: FormToolData> FormBuilder<FD>
impl<FD: FormToolData> FormBuilder<FD>
Sourcepub fn slider<FDT: Clone + PartialEq + 'static>(
self,
builder: impl BuilderFn<ControlBuilder<FD, SliderData, FDT>>,
) -> Self
pub fn slider<FDT: Clone + PartialEq + 'static>( self, builder: impl BuilderFn<ControlBuilder<FD, SliderData, FDT>>, ) -> Self
Builds a slider (or range) control and adds it to the form.
Sourcepub fn slider_cx<FDT: Clone + PartialEq + 'static>(
self,
builder: impl BuilderCxFn<ControlBuilder<FD, SliderData, FDT>, FD::Context>,
) -> Self
pub fn slider_cx<FDT: Clone + PartialEq + 'static>( self, builder: impl BuilderCxFn<ControlBuilder<FD, SliderData, FDT>, FD::Context>, ) -> Self
Bulids a slider (or range) control using the form’s context and adds it to the form.
Source§impl<FD: FormToolData> FormBuilder<FD>
impl<FD: FormToolData> FormBuilder<FD>
Sourcepub fn spacer(
self,
builder: impl BuilderFn<VanityControlBuilder<FD, SpacerData>>,
) -> Self
pub fn spacer( self, builder: impl BuilderFn<VanityControlBuilder<FD, SpacerData>>, ) -> Self
Builds a spacer and adds it to the form.
Sourcepub fn spacer_cx(
self,
builder: impl BuilderCxFn<VanityControlBuilder<FD, SpacerData>, FD::Context>,
) -> Self
pub fn spacer_cx( self, builder: impl BuilderCxFn<VanityControlBuilder<FD, SpacerData>, FD::Context>, ) -> Self
Builds a spacer using the form’s context and adds it to the form.
Source§impl<FD: FormToolData> FormBuilder<FD>
impl<FD: FormToolData> FormBuilder<FD>
Sourcepub fn stepper<FDT: Clone + PartialEq + 'static>(
self,
builder: impl BuilderFn<ControlBuilder<FD, StepperData, FDT>>,
) -> Self
pub fn stepper<FDT: Clone + PartialEq + 'static>( self, builder: impl BuilderFn<ControlBuilder<FD, StepperData, FDT>>, ) -> Self
Builds a stepper control and adds it to the form.
Sourcepub fn stepper_cx<FDT: Clone + PartialEq + 'static>(
self,
builder: impl BuilderCxFn<ControlBuilder<FD, StepperData, FDT>, FD::Context>,
) -> Self
pub fn stepper_cx<FDT: Clone + PartialEq + 'static>( self, builder: impl BuilderCxFn<ControlBuilder<FD, StepperData, FDT>, FD::Context>, ) -> Self
Builds a new stepper control using the form’s context and adds it to the form.
Source§impl<FD: FormToolData> FormBuilder<FD>
impl<FD: FormToolData> FormBuilder<FD>
Sourcepub fn submit(
self,
builder: impl BuilderFn<VanityControlBuilder<FD, SubmitData>>,
) -> Self
pub fn submit( self, builder: impl BuilderFn<VanityControlBuilder<FD, SubmitData>>, ) -> Self
Builds a submit button and adds it to the form.
Sourcepub fn submit_cx(
self,
builder: impl BuilderCxFn<VanityControlBuilder<FD, SubmitData>, FD::Context>,
) -> Self
pub fn submit_cx( self, builder: impl BuilderCxFn<VanityControlBuilder<FD, SubmitData>, FD::Context>, ) -> Self
Builds a submit button using the form’s context and adds it to the form.
Source§impl<FD: FormToolData> FormBuilder<FD>
impl<FD: FormToolData> FormBuilder<FD>
Sourcepub fn text_area<FDT: Clone + PartialEq + 'static>(
self,
builder: impl BuilderFn<ControlBuilder<FD, TextAreaData, FDT>>,
) -> Self
pub fn text_area<FDT: Clone + PartialEq + 'static>( self, builder: impl BuilderFn<ControlBuilder<FD, TextAreaData, FDT>>, ) -> Self
Builds a text area control and adds it to the form.
Sourcepub fn text_area_cx<FDT: Clone + PartialEq + 'static>(
self,
builder: impl BuilderCxFn<ControlBuilder<FD, TextAreaData, FDT>, FD::Context>,
) -> Self
pub fn text_area_cx<FDT: Clone + PartialEq + 'static>( self, builder: impl BuilderCxFn<ControlBuilder<FD, TextAreaData, FDT>, FD::Context>, ) -> Self
Builds a text area control using the forms context and adds it to the form.
Source§impl<FD: FormToolData> FormBuilder<FD>
impl<FD: FormToolData> FormBuilder<FD>
Sourcepub fn text_input<FDT: Clone + PartialEq + 'static>(
self,
builder: impl BuilderFn<ControlBuilder<FD, TextInputData, FDT>>,
) -> Self
pub fn text_input<FDT: Clone + PartialEq + 'static>( self, builder: impl BuilderFn<ControlBuilder<FD, TextInputData, FDT>>, ) -> Self
Builds a text input control and adds it to the form.
Sourcepub fn text_input_cx<FDT: Clone + PartialEq + 'static>(
self,
builder: impl BuilderCxFn<ControlBuilder<FD, TextInputData, FDT>, FD::Context>,
) -> Self
pub fn text_input_cx<FDT: Clone + PartialEq + 'static>( self, builder: impl BuilderCxFn<ControlBuilder<FD, TextInputData, FDT>, FD::Context>, ) -> Self
Builds a text input control using the form’s context and adds it to the form.
Source§impl<FD: FormToolData> FormBuilder<FD>
impl<FD: FormToolData> FormBuilder<FD>
Sourcepub fn style(self, style: <FD::Style as FormStyle>::StylingAttributes) -> Self
pub fn style(self, style: <FD::Style as FormStyle>::StylingAttributes) -> Self
Adds a styling attribute to the entire form.
Auto Trait Implementations§
impl<FD> Freeze for FormBuilder<FD>
impl<FD> !RefUnwindSafe for FormBuilder<FD>
impl<FD> !Send for FormBuilder<FD>
impl<FD> !Sync for FormBuilder<FD>
impl<FD> Unpin for FormBuilder<FD>
impl<FD> !UnwindSafe for FormBuilder<FD>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more