Create reusable React + Tailwind CSS components in one line ✨
See the code
TWC creates reusable React + Tailwind CSS components in one line
asChild proptailwind-merge and cva supportVisit our official documentation.
Without twc:
import * as React from "react";
const Card = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={clsx(
"rounded-lg border bg-slate-100 text-white shadow-sm",
className,
)}
{...props}
/>
));
With twc:
import { twc } from "react-twc";
const Card = twc.div`rounded-lg border bg-slate-100 text-white shadow-sm`;
Feel like contributing? That's awesome! We have a contributing guide to help guide you.
The docsite lives in the monorepo.
If you're interested in contributing to the documentation, check out the contributing guide.
Having trouble? Ping me on X
The development of TWC was only possible due to the inspiration and ideas from these amazing projects.
MIT License © 2023-Present Greg Bergé
(top 24 of 25)
9,435 followers · starred Dec 2023
13,582 followers · starred Mar 2024
1,954 followers · starred Dec 2023
19,088 followers · starred Dec 2023
Create reusable React + Tailwind CSS components in one line ✨
See the code
TWC creates reusable React + Tailwind CSS components in one line
asChild proptailwind-merge and cva supportVisit our official documentation.
Without twc:
import * as React from "react";
const Card = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={clsx(
"rounded-lg border bg-slate-100 text-white shadow-sm",
className,
)}
{...props}
/>
));
With twc:
import { twc } from "react-twc";
const Card = twc.div`rounded-lg border bg-slate-100 text-white shadow-sm`;
Feel like contributing? That's awesome! We have a contributing guide to help guide you.
The docsite lives in the monorepo.
If you're interested in contributing to the documentation, check out the contributing guide.
Having trouble? Ping me on X
The development of TWC was only possible due to the inspiration and ideas from these amazing projects.
MIT License © 2023-Present Greg Bergé
(top 24 of 25)
9,435 followers · starred Dec 2023
13,582 followers · starred Mar 2024
1,954 followers · starred Dec 2023
19,088 followers · starred Dec 2023