Module Solidtype_heroui.Avatar_group

HeroUI's AvatarGroup: a <div> of Avatars, with HeroUI's classes from Styles.AvatarGroup, stacked or in a grid. It gives the avatars inside it its size, color and variant, each where an avatar sets none itself, shows the first max of them, and counts the rest, "+2", unless it holds a Count of its own.

  <Avatar_group max=3>
    <Avatar><Avatar.Fallback>"AL"</Avatar.Fallback></Avatar>
    <Avatar><Avatar.Fallback>"GH"</Avatar.Fallback></Avatar>
  </Avatar_group>

React counts a group's own children; Solid cannot single them out, so an avatar joins the group as it is made, and its place among them is the order they were made in: an avatar added later, by a For, is counted after the others, wherever it is. Kobalte has no group.

type size = [
  1. | `sm
  2. | `md
  3. | `lg
]
type color = [
  1. | `default
  2. | `accent
  3. | `success
  4. | `warning
  5. | `danger
]
type variant = [
  1. | `default
  2. | `soft
]
type group = {
  1. size : unit -> size;
  2. color : unit -> color option;
  3. variant : unit -> variant option;
  4. join : unit -> unit -> bool;
    (*

    join (), as an avatar is made, counts it among the group's until its owner is cleaned up, and is whether it is shown.

    *)
  5. count : unit -> unit;
    (*

    count (), as a Count is made, has the group count none itself until its owner is cleaned up.

    *)
}

What a group gives its avatars.

module Context : sig ... end
module Count : sig ... end

The avatar that counts those a group does not show, its children the count, "+40"; a group that holds one counts none itself, and shows it whatever its max. Its size, color and variant are its own, else the group's.

module Props : sig ... end