pub struct ContainerProps {Show 15 fields
pub layout: LayoutStyle,
pub padding: SpacingEdges,
pub background: Option<Color>,
pub background_paint: Option<Paint>,
pub shadow: Option<ShadowStyle>,
pub border: Edges,
pub border_color: Option<Color>,
pub border_paint: Option<Paint>,
pub border_dash: Option<DashPatternV1>,
pub focus_ring: Option<RingStyle>,
pub focus_ring_always_paint: bool,
pub focus_border_color: Option<Color>,
pub focus_within: bool,
pub corner_radii: Corners,
pub snap_to_device_pixels: bool,
}Expand description
A low-opinionated container primitive for declarative authoring.
This is intentionally small and composable: it provides padding and an optional quad background (including border and corner radii) so component-layer recipes can build shadcn-like widgets via composition.
Fields§
§layout: LayoutStyle§padding: SpacingEdges§background: Option<Color>§background_paint: Option<Paint>Optional paint override for the container background (ADR 0233).
When set, this takes precedence over background and enables gradients/materials for
declarative container chrome.
shadow: Option<ShadowStyle>§border: Edges§border_color: Option<Color>§border_paint: Option<Paint>Optional paint override for the container border (ADR 0233).
When set, this takes precedence over border_color.
border_dash: Option<DashPatternV1>Optional dashed border pattern (v1).
focus_ring: Option<RingStyle>Optional focus-visible ring decoration.
focus_ring_always_paint: boolWhen true, paint the focus ring even when the element is not focused.
This is intended for component-layer animation parity with CSS transition outcomes
(e.g. transition-[color,box-shadow]), where the focus ring can animate out after focus
moves away.
When false (default), the focus ring is painted only while focus-visible is active.
focus_border_color: Option<Color>Optional border-color override applied when focus-visible is active.
This is primarily used for shadcn-style focus-visible:border-ring outcomes without
requiring a dedicated “border state” API at the layout layer.
focus_within: boolWhen true, focus state is derived from any focused descendant (focus-within).
corner_radii: Corners§snap_to_device_pixels: boolWhen true, snap paint bounds to device pixels (policy-only).
Trait Implementations§
Source§impl Clone for ContainerProps
impl Clone for ContainerProps
Source§fn clone(&self) -> ContainerProps
fn clone(&self) -> ContainerProps
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more