Lueur Avatar - v0.1.8
    Preparing search index...

    Interface AvatarOptions

    Defines the options for generating an SVG avatar.

    interface AvatarOptions {
        backgroundColor?: string;
        fontFamily?: string;
        fontSize?: number;
        height?: number;
        initialsLength?: number;
        shape?: AvatarShape;
        svgAttributes?: { [key: string]: string };
        text?: string;
        textColor?: string;
        width?: number;
    }
    Index

    Properties

    backgroundColor?: string

    The background color of the avatar (e.g., '#FF6600'). If not provided, a color will be deterministically generated from the username.

    fontFamily?: string

    The font family for the initials. Defaults to 'Arial, sans-serif'.

    fontSize?: number

    The font size for the initials. If not provided, it will be calculated based on avatar size.

    height?: number

    The height of the avatar in pixels. Defaults to 100.

    initialsLength?: number

    The maximum number of initials to display. Defaults to 2.

    shape?: AvatarShape

    The shape of the avatar. Defaults to 'square'.

    svgAttributes?: { [key: string]: string }

    Additional SVG attributes to apply to the root element (e.g., { class: 'my-avatar' }). Values will be stringified directly.

    text?: string

    Text to explicitly display on the avatar instead of generated initials. If provided, initialsLength and username-based initial generation will be ignored.

    textColor?: string

    The color of the text (initials) on the avatar (e.g., '#FFFFFF'). If not provided, a contrasting color will be chosen based on the background.

    width?: number

    The width of the avatar in pixels. Defaults to 100.