Struct leptos_form_tool::FormBuilder

source ·
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>

source

pub fn button( self, builder: impl BuilderFn<VanityControlBuilder<FD, ButtonBuildData<FD>>>, ) -> Self

Builds a button and adds it to the form.

source

pub fn button_cx( self, builder: impl BuilderCxFn<VanityControlBuilder<FD, ButtonBuildData<FD>>, FD::Context>, ) -> Self

Builds a button using the form’s context and adds it to the form.

source§

impl<FD: FormToolData> FormBuilder<FD>

source

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.

source

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>

source

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.

source

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.

source

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.

source

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.

source

pub fn raw_view( self, render_fn: impl Fn(Rc<FD::Style>, RwSignal<FD>, Rc<FD::Context>) -> View + '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>

source

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>

source

pub fn heading( self, builder: impl BuilderFn<VanityControlBuilder<FD, HeadingData>>, ) -> Self

Builds a heading and adds it to the form.

source

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>

source

pub fn hidden( self, builder: impl BuilderFn<VanityControlBuilder<FD, HiddenData>>, ) -> Self

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.

source

pub fn hidden_cx( self, builder: impl BuilderCxFn<VanityControlBuilder<FD, HiddenData>, FD::Context>, ) -> Self

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>

source

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.

source

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>

source

pub fn radio_buttons<FDT: Clone + PartialEq + 'static>( self, builder: impl BuilderFn<ControlBuilder<FD, RadioButtonsData, FDT>>, ) -> Self

Builds a radio buttons control and adds it to the form.

source

pub fn radio_buttons_cx<FDT: Clone + PartialEq + 'static>( self, builder: impl BuilderCxFn<ControlBuilder<FD, RadioButtonsData, FDT>, FD::Context>, ) -> Self

Builds a radio buttons control using the form’s context and adds it to the form.

source§

impl<FD: FormToolData> FormBuilder<FD>

source

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.

source

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>

source

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.

source

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>

source

pub fn spacer( self, builder: impl BuilderFn<VanityControlBuilder<FD, SpacerData>>, ) -> Self

Builds a spacer and adds it to the form.

source

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>

source

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.

source

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>

source

pub fn submit( self, builder: impl BuilderFn<VanityControlBuilder<FD, SubmitData>>, ) -> Self

Builds a submit button and adds it to the form.

source

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>

source

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.

source

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>

source

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.

source

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>

source

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more