euv_ui/component/avatar/view/struct.rs
1use super::*;
2
3/// Props for the `euv_avatar` component.
4///
5/// Defines the strongly-typed interface for a user or entity avatar that
6/// renders either an image or a text fallback.
7#[derive(Clone, CustomDebug, Default)]
8pub struct EuvAvatarProps {
9 /// The image source URL. When empty the `initials` text is rendered instead.
10 pub src: &'static str,
11 /// The alternative text describing the avatar image.
12 pub alt: &'static str,
13 /// The initials rendered as the text fallback when `src` is empty.
14 pub initials: &'static str,
15 /// The square size of the avatar.
16 pub size: EuvAvatarSize,
17 /// Whether to render the avatar as a rounded square instead of a circle.
18 pub square: Signal<bool>,
19}
20
21/// Props for the `euv_avatar_fallback` component.
22///
23/// The fallback stands in for the picture when there is none, so it
24/// carries the initials it shows.
25#[derive(Clone, CustomDebug, Data, Default, New)]
26pub struct EuvAvatarFallbackProps {
27 /// The initials shown inside the fallback.
28 pub text: &'static str,
29}
30
31/// Props for the `euv_avatar_badge` component.
32///
33/// The badge marks the avatar with a short label.
34#[derive(Clone, CustomDebug, Data, Default, New)]
35pub struct EuvAvatarBadgeProps {
36 /// The badge text.
37 pub text: &'static str,
38}
39
40/// Props for the `euv_avatar_group` component.
41///
42/// The group holds the avatars that belong together, so it takes no
43/// settings of its own.
44#[derive(Clone, CustomDebug, Default)]
45pub struct EuvAvatarGroupProps {}
46
47/// Props for the `euv_avatar_group_count` component.
48///
49/// The count names how many avatars the group holds beyond the ones it
50/// shows.
51#[derive(Clone, CustomDebug, Data, Default, New)]
52pub struct EuvAvatarGroupCountProps {
53 /// The count text.
54 pub text: &'static str,
55}