Twin blends the magic of Tailwind with the flexibility of CSS-in-js (emotion, styled-components, stitches, and goober) at build time. When babel runs over your javascript or typescript files at compile time, twin grabs your classes and converts them into CSS objects. These CSS objects are then passed into your chosen CSS-in-js library without the need for an extra client-side bundle. Twin collapses imports from common styling libraries into a single import. Adds no size to your build. Twin converts the classes you’ve used into CSS objects using Babel and then compiles away, leaving no runtime code. Twin chimes in with class and variant values from your Tailwind config. Works with the official tailwind vscode plugin. Avoid having to look up your classes with auto-completion straight from your Tailwind config. Apply variants to multiple classes at once with variant groups.

Features

  • Style jsx elements using Tailwind classes
  • Nest Twin’s tw import within a css prop to add conditional styles
  • Mix sass styles with the css import
  • You can also use the tw import to create and style new components
  • And clone and style existing components
  • Switch to the styled import to add conditional styling

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow Twin

Twin Web Site

You Might Also Like
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

The database for AI-powered applications.

MongoDB Atlas is the developer-friendly database used to build, scale, and run gen AI and LLM-powered apps—without needing a separate vector database. Atlas offers built-in vector search, global availability across 115+ regions, and flexible document modeling. Start building AI apps faster, all in one place.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Twin!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Software Development Software, JavaScript Build Tools

Registered

2022-04-06