npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@tailus/themer-avatar

v0.0.4

Published

Avatar themes

Downloads

2

Readme

Avatar Component Theme

Overview

The avatar component theme is a collection of Tailwindcss utilities that can be used to create avatars with different colors, styles, and variants. Avatars are graphical representations of users, and can be used in a variety of contexts, such as profile pages, chat rooms, and social media feeds.

Installation

To install the avatar component theme, run the following command:

npm install @tailus/themer-avatar

Importation

To import the avatar component theme, you can use the following import:

import { avatar, softFallbackAvatar } from "@tailus/themer-avatar";

Variants

The avatar component theme provides two variants:

  • solidFallback (default): The default variant.
  • softFallback: A soft variant with rounded corners and lighter background colors.

Reference

The avatar component theme object.

Avatar = {
    root: {
        xs,
        sm,
        md,
        lg,
        xl
    };
    fallback:
    {
        primary,
        secondary,
        accent,
        danger,
        warning,
        info,
        success,
        gray
    };
    image: string;
    topStatus: {online, offline, away, busy};
    bottomStatus: {online, offline, away, busy};
};

Properties

The avatar component theme object contains the following properties:

  • root: The Tailwindcss utilities for the root element of the avatar component.
  • fallback: An object containing the Tailwindcss utilities for the fallback element, which is used if the avatar does not have an image.
    • primary: The Tailwindcss utilities for the primary fallback color.
    • secondary: The Tailwindcss utilities for the secondary fallback color.
    • accent: The Tailwindcss utilities for the accent fallback color.
    • danger: The Tailwindcss utilities for the danger fallback color.
    • warning: The Tailwindcss utilities for the warning fallback color.
    • info: The Tailwindcss utilities for the info fallback color.
    • success: The Tailwindcss utilities for the success fallback color.
    • gray: The Tailwindcss utilities for the gray fallback color.
  • image: The Tailwindcss utilities for the avatar image element.
  • topStatus: An object containing the Tailwindcss utilities for the top status element, which can be used to indicate the user's online status.
    • online: The Tailwindcss utilities for the online status.
    • offline: The Tailwindcss utilities for the offline status.
    • away: The Tailwindcss utilities for the away status.
    • busy: The Tailwindcss utilities for the busy status.
  • bottomStatus: An object containing the Tailwindcss utilities for the bottom status element, which can be used to indicate the user's role or other information.
    • online: The Tailwindcss utilities for the online status.
    • offline: The Tailwindcss utilities for the offline status.
    • away: The Tailwindcss utilities for the away status.
    • busy: The Tailwindcss utilities for the busy status.

Customization

The following properties can be customized in the avatar component theme:

  • borderRadius
  • statusInset
tailus: {
    components: {
        avatar: {
            borderRadius: "full",
            statusInset: "0.5"
        }
    }
}

Usage

To use the avatar component theme, simply import the appropriate variant and add the appropriate Tailwindcss utilities to the avatar element and its child elements. For example, to create a default avatar component, you would import the default avatar variant and add its properties to the avatar element.

Example

Radix-UI

import * as Avatar from "@radix-ui/react-avatar";
import { avatar as avatarTheme } from "@tailus/themer-avatar";

const Avatar = () => (
    <div className="flex gap-5">
        <Avatar.Root className={avatarTheme.root.lg + " " + avatarTheme.topStatus.offline}>
            <Avatar.Image className={avatarTheme.image} src="" alt="Shekinah Tshiokufila" />
            <Avatar.Fallback className={avatarTheme.fallback.warning} delayMs={600}>
                ST
            </Avatar.Fallback>
        </Avatar.Root>
        <Avatar.Root className={avatarTheme.root.lg}>
            <Avatar.Fallback className={avatarTheme.fallback.warning}>ST</Avatar.Fallback>
        </Avatar.Root>
    </div>
);

export default Avatar;