This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

merge-tw-props
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Merge TW Props

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 merge-tw-props

Examples

import mergeTWProps from "merge-tw-props";

export function Checkbox(props: JSX.IntrinsicElements["input"]) {
  return (
    <input
      {...mergeTWProps(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",
      })}
    />
  );
}

Package Sidebar

Install

npm i merge-tw-props

Weekly Downloads

1

Version

1.0.3

License

Apache-2.0

Unpacked Size

5.09 kB

Total Files

6

Last publish

Collaborators

  • ed.software