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

v0.0.1

Published

Dropdown menu themes

Downloads

33

Readme

Dropdown Menu themes

Overview

The dropdown menu component theme is a collection of Tailwind utilities that can be used to create dropdown 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 dropdown menu component theme, run the following command:

npm install @tailus/themer-dropdown-menu

Importation

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

import { dropdownMenu } from "@tailus/themer-dropdown-menu";
import { softDropdownMenu } from "@tailus/themer-dropdown-menu";

Example

Radix-UI

import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
import {
    Pencil1Icon,
    ArchiveIcon,
    TrashIcon,
    FileIcon,
    DotsVerticalIcon,
} from "@radix-ui/react-icons";
import { dropdownMenu as theme } from "@tailus/themer-dropdown-menu";
import { ghostIconButton as buttonTheme } from "@tailus/themer-button";

const DropdownMenuUI = () => {
    return (
        <DropdownMenu.Root>
            <DropdownMenu.Trigger asChild>
                <button className={buttonTheme.gray.md}>
                    <span className="sr-only">Dismiss dialog</span>
                    <DotsVerticalIcon className={buttonTheme.icon.md} />
                </button>
            </DropdownMenu.Trigger>

            <DropdownMenu.Portal>
                <DropdownMenu.Content className={theme.content} sideOffset={5}>
                    <DropdownMenu.Item className={theme.item.primary}>
                        <Pencil1Icon className={theme.icon} />
                        Edit
                    </DropdownMenu.Item>
                    <DropdownMenu.Item className={theme.item.primary}>
                        <FileIcon className={theme.icon} />
                        Duplicate
                    </DropdownMenu.Item>
                    <DropdownMenu.Separator className={theme.separator} />
                    <DropdownMenu.Item className={theme.item.primary} disabled>
                        <ArchiveIcon className={theme.icon} />
                        Archive
                    </DropdownMenu.Item>
                    <DropdownMenu.Item className={theme.item.danger}>
                        <TrashIcon className={theme.icon} />
                        Delete
                    </DropdownMenu.Item>
                </DropdownMenu.Content>
            </DropdownMenu.Portal>
        </DropdownMenu.Root>
    );
};

export default DropdownMenuUI;

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:

  • dropdownMenu.content: The Tailwind css utilities for the content of the dropdown menu.
  • dropdownMenu.separator: The Tailwind css utilities for the separator line between items in the dropdown menu.
  • dropdownMenu.icon: The Tailwind css utilities for the icons that appear before the items text in the dropdown menu.
  • dropdownMenu.rightIcon:` The Tailwind css utilities for the icons that appear next to items in the dropdown menu.
  • dropdownMenu.subTrigger.primary: The Tailwind css utilities for primary items in the dropdown menu.
  • dropdownMenu.subTrigger.warning: The Tailwind css utilities for warning items in the dropdown menu.
  • dropdownMenu.subTrigger.danger: The Tailwind css utilities for danger items in the dropdown menu.
  • dropdownMenu.subTrigger.gray: The Tailwind css utilities for gray items in the dropdown menu.
  • dropdownMenu.subTrigger.neutral: The Tailwind css utilities for neutral items in the dropdown menu.
  • dropdownMenu.item.primary: The Tailwind css utilities for primary items in the dropdown menu.
  • dropdownMenu.item.warning: The Tailwind css utilities for warning items in the dropdown menu.
  • dropdownMenu.item.danger: The Tailwind css utilities for danger items in the dropdown menu.
  • dropdownMenu.item.gray: The Tailwind css utilities for gray items in the dropdown menu.
  • dropdownMenu.item.neutral: The Tailwind css utilities for neutral items in the dropdown 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
  • dropdown menu border radius
  • separator light color
  • separator dark color

To customize the dropdown 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",
            }
        },
    },
},