Skip to content
Stylhero 0.6.2
React Native

Theme

Core

Feedback

Inputs

Navigation

Overlays

React Native / Core

Avatar

Round photo or initials for a person, team or product.

import { Avatar } from "@stylhero/native";

Example

import { Avatar, Stack } from "@stylhero/native";

function AvatarExample() {
  return (
    <Stack direction="row" gap={3}>
      <Avatar name="Ana López" size="sm" />
      <Avatar name="Sam Lee" />
      <Avatar name="Kim Park" size="lg" />
    </Stack>
  );
}

Props

PropTypeDefaultDescription
name required string - The person's or thing's name: the spoken label and the source of the initials.
decorative boolean - Hide from screen readers when the name is already shown next to it (e.g. in a ListItem).
size "sm" | "md" | "lg" | number "md" "sm" 32, "md" 40 (default), "lg" 56, or a size in points.
source ImageSourcePropType - Photo. Falls back to initials while missing or if it fails to load.
style StyleProp<ViewStyle> -
testID string -

Accessibility

  • An image named after the person. Use decorative when the name is already next to it, so it isn't read twice.

Generated from src/components/Avatar.tsx. Something wrong or missing? Open an issue.