You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

tailwindcss-primeui

Package Overview
Dependencies
Maintainers
0
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tailwindcss-primeui

Utilities for Tailwind CSS

0.4.0
Source
npm
Version published
Weekly downloads
82K
2.37%
Maintainers
0
Weekly downloads
 
Created
Source

Tailwind CSS Utilities for Prime UI Libraries

Extended utilities to integrate Prime UI library theming with Tailwind CSS and add the missing animation utilities from the legacy PrimeFlex.

Prime UI Library

This plugin requires a Prime UI library with the next-gen theming, compatible with styled and unstyled modes.

  • primevue v4+
  • primeng v18+
  • @primereact/core v1+

Installation

Install the plugin from npm.

npm i tailwindcss-primeui

Add the plugin to your tailwind.config.js file.

// tailwind.config.js
module.exports = {
    // ...
    plugins: [require('tailwindcss-primeui')]
};

Colors

Prime UI libraries utilize a color palette that consists of primary colors and surfaces, these colors can be used as Tailwind extensions.

<div class="bg-primary text-primary-contrast border-primary-500">Content</div>
<div class="bg-surface-50 dark:bg-surface-900 text-surface-900 dark:text-surface-0 border-surface-200 dark:border-surface-700">Content</div>
ColorDescription
primary-[50-950]Primary colors
surface-[0-950]Surface colors
primaryDefault primary color
primary-contrastDefault primary contrast color
primary-emphasisDefault primary emphasis color

Special preset classes defined by the Prime UI library theme preset such as Aura, Lara, or Nora.

ColorDescription
border-surfaceBorder color
bg-emphasisEmphasis background, e.g. hovered element
bg-highlightHighlight background
bg-highlight-emphasisHighlight background with emphasis
rounded-borderBorder radius
text-colorText color
text-color-emphasisText color with emphasis
text-muted-colorSecondary text color
text-muted-color-emphasisSecondary text color with emphasis

Animations

PrimeFlex provide various animation utilities that are missing in Tailwind CSS core, this plugin adds these plugins for migration.

Duration

ClassProperties
animate-duration-0animation-duration: 0s;
animate-duration-75animation-duration: 75ms;
animate-duration-100animation-duration: 100ms;
animate-duration-150animation-duration: 150ms;
animate-duration-200animation-duration: 200ms;
animate-duration-300animation-duration: 300ms;
animate-duration-400animation-duration: 400ms;
animate-duration-500animation-duration: 500ms;
animate-duration-700animation-duration: 700ms;
animate-duration-1000animation-duration: 1000ms;
animate-duration-2000animation-duration: 2000ms;
animate-duration-3000animation-duration: 3000ms;

Delay

ClassProperties
animate-delay-noneanimation-delay: 0ms;
animate-delay-75animation-delay: 75ms;
animate-delay-100animation-delay: 100ms;
animate-delay-150animation-delay: 150ms;
animate-delay-200animation-delay: 200ms;
animate-delay-300animation-delay: 300ms;
animate-delay-400animation-delay: 400ms;
animate-delay-500animation-delay: 500ms;
animate-delay-700animation-delay: 700ms;
animate-delay-1000animation-delay: 1000ms;

Iteration Count

ClassProperties
animate-infiniteanimation-iteration-count: infinite;
animate-onceanimation-iteration-count: 1;
animate-twiceanimation-iteration-count: 2;

Direction

ClassProperties
animate-normalanimation-direction: normal;
animate-reverseanimation-direction: reverse;
animate-alternateanimation-direction: alternate;
animate-alternate-reverseanimation-direction: alternate-reverse;

Timing Function

ClassProperties
animate-ease-linearanimation-timing-function: linear;
animate-ease-inanimation-timing-function: cubic-bezier(0.4, 0, 1, 1);
animate-ease-outanimation-timing-function: cubic-bezier(0, 0, 0.2, 1);
animate-ease-in-outanimation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);

Fill Mode

ClassProperties
animate-fill-noneanimation-fill-mode: normal;
animate-fill-forwardsanimation-fill-mode: forwards;
animate-fill-backwardsanimation-fill-mode: backwards;
animate-fill-bothanimation-fill-mode: both;

Play State

ClassProperties
animate-runninganimation-play-state: running;
animate-pausedanimation-play-state: paused;

Backface Visibility

ClassProperties
backface-visiblebackface-visibility: visible;
backface-hiddenbackface-visibility: hidden;

Animations

ClassProperties
animate-fadeinfadein 0.15s linear
animate-fadeoutfadeout 0.15s linear
animate-slidedownslidedown 0.45s ease-in-out
animate-slideupslideup 0.45s cubic-bezier(0, 1, 0, 1)
animate-scaleinscalein 0.15s linear
animate-fadeinleftfadeinleft 0.15s linear
animate-fadeoutleftfadeoutleft 0.15s linear
animate-fadeinrightfadeinright 0.15s linear
animate-fadeoutrightfadeoutright 0.15s linear
animate-fadeinupfadeinup 0.15s linear
animate-fadeoutupfadeoutup 0.15s linear
animate-fadeindownfadeindown 0.15s linear
animate-fadeoutupfadeoutup 0.15s linear
animate-widthwidth 0.15s linear
animate-flipflip 0.15s linear
animate-flipupflipup 0.15s linear
animate-flipleftflipleft 0.15s linear
animate-fliprightflipright 0.15s linear
animate-zoominzoomin 0.15s linear
animate-zoomindownzoomindown 0.15s linear
animate-zoominleftzoominleft 0.15s linear
animate-zoominrightzoominright 0.15s linear
animate-zoominupzoominup 0.15s linear

Enter and Leave

| animate-enter | | | animate-leave | |

Fade In and Out

Values are derived from the Tailwind CSS opacity e.g. fade-in-50 and fade-out-20. Arbitrary values such as fade-in-[15] are also supported.

| fade-in-{value} | --p-enter-opacity: {value} | | fade-out-{value} | --p-leave-opacity: {value} |

Zoom In and Out

Values are derived from the Tailwind CSS scale e.g. zoom-in-50 and zoom-out-75. Arbitrary values such as zoom-in-[0.8] are also supported.

| zoom-in-{value} | --p-enter-scale: {value} | | zoom-out-{value} | --p-leave-scale: {value} |

Spin In and Out

Values are derived from the Tailwind CSS rotate e.g. spin-in-45 and spin-out-90. Arbitrary values such as spin-in-[60deg] are also supported.

| spin-in-{value} | --p-enter-rotate: {value} | | spin-out-{value} | --p-leave-rotate: {value} |

Slide In and Out

Values are derived from the Tailwind CSS translate e.g. slide-in-from-t-50 and slide-out-to-l-8. Arbitrary values such as slide-in-from-b-[8px] are also supported.

| slide-in-from-t-{value} | --p-enter-translate-y: -{value} | | slide-in-from-t-{value} | --p-enter-translate-y: {value} | | slide-in-from-t-{value} | --p-enter-translate-x: -{value} | | slide-in-from-t-{value} | --p-enter-translate-x: {value} | | slide-out-to-t-{value} | --p-leave-translate-y: -{value} | | slide-out-to-t-{value} | --p-leave-translate-y: {value} | | slide-out-to-t-{value} | --p-leave-translate-x: -{value} | | slide-out-to-t-{value} | --p-leave-translate-x: {value} |

Variant modifiers and breakpoints

All variants and breakpoints are supported.

<div class="lg:hover:bg-primary lg:hover:animate-fadein motion-reduce:animate-none">
    <!-- ... -->
</div>

Arbitrary values

Any value within the square brackets allow defining one-off values that do not need to be defined as a reusable utility.

<div class="animate-delay-[450ms] animate-duration-[4s]">
    <!-- ... -->
</div>

Customizing the Plugin

The default values can be customized using as a theme extension.

// tailwind.config.js
module.exports = {
    theme: {
        extend: {
            animationDelay: {
                475: '475ms',
                2000: '2s'
            },
            animationDuration: {
                4000: '4s',
                slow: '10s'
            }
        }
    },
    plugins: [require('tailwindcss-primeui')]
};

Keywords

tailwindcss

FAQs

Package last updated on 12 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts