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-context-menu

v0.0.1

Published

Context menu themes

Downloads

10

Readme

Context Menu themes

Overview

The context menu component theme is a collection of Tailwind utilities that can be used to create context menus with different variants and colors. The default variant is solid, but there is also a soft variant. Each variant has a number of properties that can be customized, including the shadow, border colors, background opacity, backdrop blur, radius, and separator colors.

Installation

To install the context menu component theme, run the following command:

npm install @tailus/themer-context-menu

Importation

To import the context menu component theme, you can use one of the following imports:

import { contextMenu } from "@tailus/themer-context-menu";
import { softContextMenu } from "@tailus/themer-context-menu";

Example

Radix UI

import * as ContextMenu from "@radix-ui/react-context-menu";
import { ChevronRightIcon } from "@radix-ui/react-icons";
import { contextMenu as contextTheme } from "@tailus/themer-context-menu";

const ContextMenuUI = () => {
    return (
        <ContextMenu.Root>
            <div className="-mt-12">
                <span className="text-gray-700 dark:text-gray-300">Right click the logo.</span>

                <ContextMenu.Trigger>
                    <div className="mt-12 mx-auto w-fit rounded-[--menu-border-radius] px-4 py-2 transition duration-300 hover:bg-gray-100 dark:hover:bg-white/5">
                        <img className="w-16 h-16 mx-auto" src="/tls/x512.png" alt="" />
                        <span className="text-xs font-medium text-gray-700 dark:text-gray-300">
                            tailus-logo.png
                        </span>
                    </div>
                </ContextMenu.Trigger>
            </div>

            <ContextMenu.Portal>
                <ContextMenu.Content className={contextTheme.content}>
                    <ContextMenu.Item className={contextTheme.item.primary}>
                        Scale <div className={contextTheme.command}>⌘+S</div>
                    </ContextMenu.Item>
                    <ContextMenu.Item className={contextTheme.item.primary}>
                        Set to Primary <div className={contextTheme.command}>⌘+P</div>
                    </ContextMenu.Item>
                    <ContextMenu.Separator className={contextTheme.separator} />
                    <ContextMenu.Item className={contextTheme.item.primary}>Copy </ContextMenu.Item>
                    <ContextMenu.Item className={contextTheme.item.primary}>
                        Share...{" "}
                    </ContextMenu.Item>
                    <ContextMenu.Separator className={contextTheme.separator} />
                    <ContextMenu.Sub>
                        <ContextMenu.SubTrigger className={contextTheme.subTriger.primary}>
                            Download
                            <div className={contextTheme.icon}>
                                <ChevronRightIcon />
                            </div>
                        </ContextMenu.SubTrigger>
                        <ContextMenu.Portal>
                            <ContextMenu.SubContent
                                className={contextTheme.subContent}
                                sideOffset={4}
                                alignOffset={-5}
                            >
                                <ContextMenu.Item className={contextTheme.item.primary}>
                                    Logomark{" "}
                                </ContextMenu.Item>
                                <ContextMenu.Item className={contextTheme.item.primary}>
                                    Logotype{" "}
                                </ContextMenu.Item>
                                <ContextMenu.Separator className={contextTheme.separator} />

                                <ContextMenu.Item className={contextTheme.item.primary}>
                                    All{" "}
                                </ContextMenu.Item>
                            </ContextMenu.SubContent>
                        </ContextMenu.Portal>
                    </ContextMenu.Sub>
                    <ContextMenu.Separator className={contextTheme.separator} />
                    <ContextMenu.Item className={contextTheme.item.warning}>
                        Archive <div className={contextTheme.command}>⌘+D</div>
                    </ContextMenu.Item>
                    <ContextMenu.Item className={contextTheme.item.danger}>
                        Delete <div className={contextTheme.command}>⌘+D</div>
                    </ContextMenu.Item>
                </ContextMenu.Content>
            </ContextMenu.Portal>
        </ContextMenu.Root>
    );
};

export default ContextMenuUI;

Variants

The following variants are available:

  • solid: The default variant.
  • soft: A softer variant with rounded corners and a lighter background color.

Colors

The following colors are available for the solid variant:

  • primary
  • warning
  • danger
  • gray
  • neutral

The soft variant has all of the same colors as the solid variant except for the neutral color.

Properties

The following properties can be customized:

  • contextMenu.content: The Tailwind css utilities for the content of the context menu.
  • contextMenu.separator: The Tailwind css utilities for the separator line between items in the context menu.
  • contextMenu.icon:` The Tailwind css utilities for the icons that appear next to items in the context menu.
  • contextMenu.command: The Tailwind css utilities for the command items in the context menu.
  • contextMenu.subTrigger.primary: The Tailwind css utilities for primary items in the context menu.
  • contextMenu.subTrigger.warning: The Tailwind css utilities for warning items in the context menu.
  • contextMenu.subTrigger.danger: The Tailwind css utilities for danger items in the context menu.
  • contextMenu.subTrigger.gray: The Tailwind css utilities for gray items in the context menu.
  • contextMenu.subTrigger.neutral: The Tailwind css utilities for neutral items in the context menu.
  • contextMenu.item.primary: The Tailwind css utilities for primary items in the context menu.
  • contextMenu.item.warning: The Tailwind css utilities for warning items in the context menu.
  • contextMenu.item.danger: The Tailwind css utilities for danger items in the context menu.
  • contextMenu.item.gray: The Tailwind css utilities for gray items in the context menu.
  • contextMenu.item.neutral: The Tailwind css utilities for neutral items in the context menu.

Customization

The following properties can be customized:

  • shadow
  • light border color
  • dark border color
  • light background opacity
  • dark background
  • light backdrop blur
  • dark backdrop blur
  • context menu border radius
  • separator light color
  • separator dark color

To customize the context menu component theme, you can override The Tailwind css utilitieses in your own tailwind.config file.

tailus: {
    components: {
        menu: {
            borderRadius: "2xl",
            borderColor : "200",
            separator : "200",
            backgroundOpacity : "90%",
            backdropBlur : "xl",
            shadow : {
                size : "lg",
                opacity : "10"
            },
            dark : {
                borderColor : "800",
                separator : "800",
                background : "950",
                backgroundOpacity : "90%",
                backdropBlur : "2xl",
            }
        },
    },
},