pub struct Badge {
pub text: String,
pub icon: Option<String>,
pub variant: BadgeVariant,
pub badge_size: BadgeSize,
pub dot: bool,
pub dot_color: Option<String>,
pub pulse: bool,
pub count: Option<u32>,
pub timing: TimingConfig,
pub style: CssStyle,
pub timeline: Vec<TimelineStep>,
pub stagger: Option<f32>,
}badge is a frozen composition (issue #333). Compose a rounded div/card pill + icon + text instead — see crates/rustmotion/skills/rules/composition-recipes.md and examples/composition-pill-row.json. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
Fields§
§text: Stringbadge is a frozen composition (issue #333). Compose a rounded div/card pill + icon + text instead — see crates/rustmotion/skills/rules/composition-recipes.md and examples/composition-pill-row.json. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
icon: Option<String>badge is a frozen composition (issue #333). Compose a rounded div/card pill + icon + text instead — see crates/rustmotion/skills/rules/composition-recipes.md and examples/composition-pill-row.json. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
variant: BadgeVariantbadge is a frozen composition (issue #333). Compose a rounded div/card pill + icon + text instead — see crates/rustmotion/skills/rules/composition-recipes.md and examples/composition-pill-row.json. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
badge_size: BadgeSizebadge is a frozen composition (issue #333). Compose a rounded div/card pill + icon + text instead — see crates/rustmotion/skills/rules/composition-recipes.md and examples/composition-pill-row.json. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
dot: boolbadge is a frozen composition (issue #333). Compose a rounded div/card pill + icon + text instead — see crates/rustmotion/skills/rules/composition-recipes.md and examples/composition-pill-row.json. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
Show a small colored dot indicator.
dot_color: Option<String>badge is a frozen composition (issue #333). Compose a rounded div/card pill + icon + text instead — see crates/rustmotion/skills/rules/composition-recipes.md and examples/composition-pill-row.json. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
Dot color (defaults to the badge background color).
pulse: boolbadge is a frozen composition (issue #333). Compose a rounded div/card pill + icon + text instead — see crates/rustmotion/skills/rules/composition-recipes.md and examples/composition-pill-row.json. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
Animate the dot with a pulse effect.
count: Option<u32>badge is a frozen composition (issue #333). Compose a rounded div/card pill + icon + text instead — see crates/rustmotion/skills/rules/composition-recipes.md and examples/composition-pill-row.json. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
Show a numeric count badge (e.g. notification count).
timing: TimingConfigbadge is a frozen composition (issue #333). Compose a rounded div/card pill + icon + text instead — see crates/rustmotion/skills/rules/composition-recipes.md and examples/composition-pill-row.json. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
style: CssStylebadge is a frozen composition (issue #333). Compose a rounded div/card pill + icon + text instead — see crates/rustmotion/skills/rules/composition-recipes.md and examples/composition-pill-row.json. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
align-self defaults to flex-start (not the flex container’s
stretch) — a badge is an atomic icon+label chip that must keep its
natural intrinsic width even inside a flex/card column; without
this, the default cross-axis stretch wins over BadgeIntrinsic
and the chip becomes a full-width bar. An author-specified
align-self in JSON is always respected (this only fills the gap
when it’s absent).
timeline: Vec<TimelineStep>badge is a frozen composition (issue #333). Compose a rounded div/card pill + icon + text instead — see crates/rustmotion/skills/rules/composition-recipes.md and examples/composition-pill-row.json. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
stagger: Option<f32>badge is a frozen composition (issue #333). Compose a rounded div/card pill + icon + text instead — see crates/rustmotion/skills/rules/composition-recipes.md and examples/composition-pill-row.json. Kept for compatibility; scheduled for removal in a future major version via rustmotion migrate (#335).
Trait Implementations§
Source§impl Animatable for Badge
impl Animatable for Badge
fn animation_effects(&self) -> &[AnimationEffect]
fn timeline_steps(&self) -> &[TimelineStep]
Source§impl<'de> Deserialize<'de> for Badge
impl<'de> Deserialize<'de> for Badge
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 Badge
impl JsonSchema for Badge
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 Badge
impl Painter for Badge
fn paint_content( &self, canvas: &Canvas, layout: &BoxLayout, _props: &AnimatedProperties, ctx: &PaintCtx, )
fn intrinsic_size( &self, _available: AvailableSize, _ctx: &MeasureCtx, ) -> Option<(f32, f32)>
Auto Trait Implementations§
impl Freeze for Badge
impl RefUnwindSafe for Badge
impl Send for Badge
impl Sync for Badge
impl Unpin for Badge
impl UnsafeUnpin for Badge
impl UnwindSafe for Badge
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