Skip to main content

BoxProps

Struct BoxProps 

Source
pub struct BoxProps {
Show 47 fields pub children: Element, pub display: BoxDisplay, pub flex_direction: FlexDirection, pub flex_wrap: FlexWrap, pub justify_content: JustifyContent, pub align_items: AlignItems, pub padding: SpacingSize, pub px: Option<SpacingSize>, pub py: Option<SpacingSize>, pub pt: Option<SpacingSize>, pub pr: Option<SpacingSize>, pub pb: Option<SpacingSize>, pub pl: Option<SpacingSize>, pub margin: SpacingSize, pub mx: Option<SpacingSize>, pub my: Option<SpacingSize>, pub mt: Option<SpacingSize>, pub mr: Option<SpacingSize>, pub mb: Option<SpacingSize>, pub ml: Option<SpacingSize>, pub gap: SpacingSize, pub background: BackgroundColor, pub border_radius: RadiusSize, pub border: BorderWidth, pub border_color: Option<BackgroundColor>, pub shadow: ShadowSize, pub width: Option<String>, pub height: Option<String>, pub min_width: Option<String>, pub min_height: Option<String>, pub max_width: Option<String>, pub max_height: Option<String>, pub overflow: Overflow, pub position: Position, pub top: Option<String>, pub right: Option<String>, pub bottom: Option<String>, pub left: Option<String>, pub z_index: Option<i16>, pub opacity: Option<f32>, pub cursor: Option<String>, pub onclick: Option<EventHandler<MouseEvent>>, pub onmouseenter: Option<EventHandler<MouseEvent>>, pub onmouseleave: Option<EventHandler<MouseEvent>>, pub style: Option<String>, pub class: Option<String>, pub id: Option<String>,
}
Expand description

Box component properties

Fields§

§children: Element

Box content

§display: BoxDisplay

Display type

§flex_direction: FlexDirection

Flex direction (when display is flex)

§flex_wrap: FlexWrap

Flex wrap

§justify_content: JustifyContent

Justify content

§align_items: AlignItems

Align items

§padding: SpacingSize

Padding (all sides)

§px: Option<SpacingSize>

Padding X (horizontal)

§py: Option<SpacingSize>

Padding Y (vertical)

§pt: Option<SpacingSize>

Padding top

§pr: Option<SpacingSize>

Padding right

§pb: Option<SpacingSize>

Padding bottom

§pl: Option<SpacingSize>

Padding left

§margin: SpacingSize

Margin (all sides)

§mx: Option<SpacingSize>

Margin X (horizontal)

§my: Option<SpacingSize>

Margin Y (vertical)

§mt: Option<SpacingSize>

Margin top

§mr: Option<SpacingSize>

Margin right

§mb: Option<SpacingSize>

Margin bottom

§ml: Option<SpacingSize>

Margin left

§gap: SpacingSize

Gap between children (for flex/grid)

§background: BackgroundColor

Background color

§border_radius: RadiusSize

Border radius

§border: BorderWidth

Border width

§border_color: Option<BackgroundColor>

Border color (uses border color from theme by default)

§shadow: ShadowSize

Box shadow

§width: Option<String>

Width (e.g., “100%”, “200px”, “auto”)

§height: Option<String>

Height (e.g., “100%”, “200px”, “auto”)

§min_width: Option<String>

Minimum width

§min_height: Option<String>

Minimum height

§max_width: Option<String>

Maximum width

§max_height: Option<String>

Maximum height

§overflow: Overflow

Overflow behavior

§position: Position

Position type

§top: Option<String>

Top position (when position is not static)

§right: Option<String>

Right position

§bottom: Option<String>

Bottom position

§left: Option<String>

Left position

§z_index: Option<i16>

Z-index

§opacity: Option<f32>

Opacity (0.0 - 1.0)

§cursor: Option<String>

Cursor style

§onclick: Option<EventHandler<MouseEvent>>

Click handler

§onmouseenter: Option<EventHandler<MouseEvent>>

Mouse enter handler

§onmouseleave: Option<EventHandler<MouseEvent>>

Mouse leave handler

§style: Option<String>

Custom inline styles

§class: Option<String>

Custom class name

§id: Option<String>

Element ID

Implementations§

Source§

impl BoxProps

Source

pub fn builder() -> BoxPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>

Create a builder for building BoxProps. On the builder, call .children(...)(optional), .display(...)(optional), .flex_direction(...)(optional), .flex_wrap(...)(optional), .justify_content(...)(optional), .align_items(...)(optional), .padding(...)(optional), .px(...)(optional), .py(...)(optional), .pt(...)(optional), .pr(...)(optional), .pb(...)(optional), .pl(...)(optional), .margin(...)(optional), .mx(...)(optional), .my(...)(optional), .mt(...)(optional), .mr(...)(optional), .mb(...)(optional), .ml(...)(optional), .gap(...)(optional), .background(...)(optional), .border_radius(...)(optional), .border(...)(optional), .border_color(...)(optional), .shadow(...)(optional), .width(...)(optional), .height(...)(optional), .min_width(...)(optional), .min_height(...)(optional), .max_width(...)(optional), .max_height(...)(optional), .overflow(...)(optional), .position(...)(optional), .top(...)(optional), .right(...)(optional), .bottom(...)(optional), .left(...)(optional), .z_index(...)(optional), .opacity(...)(optional), .cursor(...)(optional), .onclick(...)(optional), .onmouseenter(...)(optional), .onmouseleave(...)(optional), .style(...)(optional), .class(...)(optional), .id(...)(optional) to set the values of the fields. Finally, call .build() to create the instance of BoxProps.

Trait Implementations§

Source§

impl Clone for BoxProps

Source§

fn clone(&self) -> BoxProps

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl PartialEq for BoxProps

Source§

fn eq(&self, other: &BoxProps) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Properties for BoxProps
where Self: Clone,

Source§

type Builder = BoxPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>

The type of the builder for this component. Used to create “in-progress” versions of the props.
Source§

fn builder() -> Self::Builder

Create a builder for this component.
Source§

fn memoize(&mut self, new: &Self) -> bool

Make the old props equal to the new props. Return if the props were equal and should be memoized.
Source§

fn into_vcomponent<M>( self, render_fn: impl ComponentFunction<Self, M>, ) -> VComponent
where M: 'static,

Create a component from the props.
Source§

impl StructuralPartialEq for BoxProps

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> InitializeFromFunction<T> for T

Source§

fn initialize_from_function(f: fn() -> T) -> T

Create an instance of this type from an initialization function
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<Ret> SpawnIfAsync<(), Ret> for Ret

Source§

fn spawn(self) -> Ret

Spawn the value into the dioxus runtime if it is an async block
Source§

impl<T, O> SuperFrom<T> for O
where O: From<T>,

Source§

fn super_from(input: T) -> O

Convert from a type to another type.
Source§

impl<T, O, M> SuperInto<O, M> for T
where O: SuperFrom<T, M>,

Source§

fn super_into(self) -> O

Convert from a type to another type.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
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
Source§

impl<T> DependencyElement for T
where T: 'static + PartialEq + Clone,