Skip to content

Utility for intelligently merging React component props using Tailwind

Notifications You must be signed in to change notification settings

ed-software/prpx

Repository files navigation

prpx NodeJS CI

Utility for intelligently merging React component props using TailwindCSS classes. Merges as many props objects as you give it. Intelligently combines TailwindCSS classes, merges refs, chains event handlers and merges styles.

Built on top of tailwind-merge and react-merge-refs.

Authors

Installation

Install with npm

npm i prpx

Examples

import { prpx } from "prpx";

export function Checkbox(props: JSX.IntrinsicElements["input"]) {
  return (
    <input
      {...prpx(props, {
        type: "checkbox",
        className:
          "h-4 w-4 rounded border-gray-300 text-brand-600 focus:ring-brand-500 dark:bg-gray-900 dark:border-gray-700",
      })}
    />
  );
}

About

Utility for intelligently merging React component props using Tailwind

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published