pub struct ContainerComponent {
pub children: Vec<ChildComponent>,
pub timing: TimingConfig,
pub style: CssStyle,
pub timeline: Vec<TimelineStep>,
pub stagger: Option<f32>,
pub time_scale: Option<f64>,
pub time_offset: Option<f64>,
}Expand description
The single layout container — the HTML <div> equivalent. Lays out
children via flex (default) or grid, decorated purely by style
(background, border-radius, box-shadow, … — all opt-in, none
applied by default) and gets display: flex automatically when style
doesn’t set one, like every other layout container.
Six spellings of "type" all deserialize into this same struct and
render identically: "div" (canonical), plus "container", "card",
"flex", "grid", and "positioned" kept as aliases for backward
compatibility. None of them carries different behavior — a "card"
with no background set is exactly as undecorated as a "div", and a
"positioned" is exactly as capable of flex/grid flow as any other
spelling; position: {x, y} on a child works the same way inside all
six, since it’s a property of the child, not of the container.
Fields§
§children: Vec<ChildComponent>§timing: TimingConfig§style: CssStyle§timeline: Vec<TimelineStep>§stagger: Option<f32>§time_scale: Option<f64>§time_offset: Option<f64>Trait Implementations§
Source§impl Animatable for ContainerComponent
impl Animatable for ContainerComponent
fn animation_effects(&self) -> &[AnimationEffect]
fn timeline_steps(&self) -> &[TimelineStep]
Source§impl Debug for ContainerComponent
impl Debug for ContainerComponent
Source§impl<'de> Deserialize<'de> for ContainerComponent
impl<'de> Deserialize<'de> for ContainerComponent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for ContainerComponent
impl JsonSchema for ContainerComponent
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl Painter for ContainerComponent
impl Painter for ContainerComponent
fn paint_content( &self, _canvas: &Canvas, _layout: &BoxLayout, _props: &AnimatedProperties, _ctx: &PaintCtx, )
fn intrinsic_size( &self, _available: AvailableSize, _ctx: &MeasureCtx, ) -> Option<(f32, f32)>
Source§impl Serialize for ContainerComponent
impl Serialize for ContainerComponent
Source§impl Styled for ContainerComponent
impl Styled for ContainerComponent
fn style_config(&self) -> &CssStyle
Source§impl StyledMut for ContainerComponent
impl StyledMut for ContainerComponent
fn style_config_mut(&mut self) -> &mut CssStyle
Auto Trait Implementations§
impl Freeze for ContainerComponent
impl RefUnwindSafe for ContainerComponent
impl Send for ContainerComponent
impl Sync for ContainerComponent
impl Unpin for ContainerComponent
impl UnsafeUnpin for ContainerComponent
impl UnwindSafe for ContainerComponent
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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