classnames
storybook
Our great sponsors
classnames | storybook | |
---|---|---|
94 | 321 | |
17,360 | 82,727 | |
- | 0.7% | |
8.4 | 10.0 | |
1 day ago | 7 days ago | |
JavaScript | TypeScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
classnames
-
Gatsby blog: Building SEO-friendly blog with BCMS code starter
The component needs the classname dependency and a search icon which I referenced to work. So install the classname package and download the search icon below.
-
The 20 most used React libraries
classnames: Makes dynamic CSS class application a breeze. Learn more
-
Beyond the Basics: Exploring TailwindCSS and Linaria in Next.js - From Installation to Performance Optimization
But of course, it is a button, so it could have multiple variants: primary and secondary(you can increase the number of customizable params, but we will limit it to 1, variant). To implement this you can use any library for combining classnames, for example, classnames, clsx. Let’s use the classic one, "classnames".
-
Is it okay to split long lists of class names across multiple lines? Why don't you?
Use classnames and you can comma delimited your class names where needed.
-
Creating an Image Upload Modal with Crop and Rotate Functionality in React
To get started with our image modal implementation, i'll assume you already have a React project set up. For UI i’m using Tailwind CSS. But you can use any UI library as your wish. For the image cropping and rotating functionality, we'll be utilizing the react-easy-crop library. This library provides a simple and intuitive way to crop and interact with images and videos within a React component. We will also use the heroicons and classnames libraries in our tutorial. To install all the libraries and their dependencies, open your terminal and navigate to your project's directory. Run the following command:
-
TailwindCSS & Template Literals
Save yourself some headache and use https://github.com/JedWatson/classnames
-
Dynamic CSS based on props: conditional className or style? (using CSS modules)
There is an NPM module called classnames that makes this a bit easier: https://www.npmjs.com/package/classnames
-
Type Safe Tailwind and SCSS Modules
To use the global Tailwind types from styles/cssClasses.d.ts, I've leveraged a lot of work from this post, so credit goes there for a lot of the complex TypeScript wizardry that makes things work. In essence, it builds upon the classnames (or clsx) to provide a helper function that gives us with the type safety we're after. This cleverness means we get type checking that works with whitespace, multiple classes (e.g., "container p-5")and arbitrary values (e.g., "border-[5px]"). The input "container p-5 invalid-class" provides the nifty error message:
-
Simplify Your Tailwind CSS Workflow with tailwind-fun
but I wouldn't recommend it, because I think the point of using tailwind is to not having to abstract class into component based style. it even better to write tailwind classes into the html directly and to use tailwind-fun sparingly and only if you needed to add logic to your classes. tailwind-fun purpose is more like of https://www.npmjs.com/package/classnames rather than any other css library
-
For tailwind users, how do you quickly make sense of what's going on in your html/jsx without semantic css class names? For instance `card`, `card--text`, `card--title` conveys a lot of information that i've felt missing so far in my tailwind journey.
Use the classnames library, that way I can group the utility classes together (one line) and break them up into multiple lines, and additionally have some of them be conditional based on variables/parameters;
storybook
-
Storybook not picking up tailwindcss
[Bug]: Configuration with TailwindCss Next.js using Tailwind with Storybook
-
Astro.js as an alternative to Next.js: pushing the limits
Astro has no runtime. This means no unit tests. This also means no Storybook for your Astro components (although, they’re working on it!)
-
Release Radar • March 2024 Edition
If you're into UI development, then you need to know about Storybook. It's a frontend workshop for building UI components and pages in isolation. The latest version brings some big improvements for testing and documentation with built-in visual testing. There's also React Server Component support, improved controls for React and Vue projects, as well as improved Vite architecture, Vitest testing, and Vite 5 support. Check out all the major changes in the Storybook changelog.
-
Top 10 Tools Every React Developer Needs in 2024
Storybook
-
Announcing AnalogJS 1.0 🚀
We are continuing to make building fullstack websites and application with Analog and Angular as seamless as possible, and extending the Angular ecosystem through integrations with Astro, Nx, [Vitest]https://analogjs.org/docs/features/testing/vitest, Storybook, and more.
-
Storybook 8
Storybook is the industry standard UI tool for building, testing, and documenting components and pages. It’s used by thousands of teams globally, integrates with all major JavaScript frameworks, and combines with most leading design and developer tools.
-
Add Cypress, Playwright, and Storybook to Nx Expo Apps
Expo has first-class support for building full-stack websites with React, so I can leverage that to add Cypress/Playwright for E2E testing and add the Storybook for UI components.
-
13 best React debugging tools
Storybook emerges as a pioneering solution among React debugging tools, offering an interactive environment for developers to create and test UI components. With its robust platform, teams can build, organize, and design UI components, and even entire screens, without the hurdles of business logic and plumbing.
-
Javascript is hard ayy eff
3) Look into things like StoryBook for your components - https://storybook.js.org/ - they help you get into good practices and expose you to some more advanced techniques but in a gradual and friendly way, and again, it's good to get into good habits from the start, and these help make sure you're getting into those good habits (it can be hard to learn good habits, but being forced into them helps, I find!)
-
Storybook 7.6 is out!
[Storybook 7.6](https://github.com/storybookjs/storybook/releases) is here with increased performance and much more! 🔥 Improved SWC support 🧪 New test utilities and fast build mode 🔼 NextJS SWC + avif support & fixes 🤡 SvelteKit page and navigation mocking ⚛️ React-docgen upgrade 🎨 Controls a11y, background theming, and viewports 🩺 CLI: The doctor is in! 🚫 Addons: Remove React as a peer dependency 🪦 Storyshots and Vue2 deprecated
What are some alternatives?
clsx - A tiny (239B) utility for constructing `className` strings conditionally.
Docusaurus - Easy to maintain open source documentation websites.
tailwind-merge - Merge Tailwind CSS classes without style conflicts
fluentui-blazor - Microsoft Fluent UI Blazor components library. For use with .NET 6.0 or higher Blazor applications
chakra-ui - ⚡️ Simple, Modular & Accessible UI Components for your React Applications
react-styleguidist - Isolated React component development environment with a living style guide
styled-components - Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress 💅
fractal - A tool to help you build and document website component libraries and design systems.
linaria - Zero-runtime CSS in JS library
svelte-luna - svelte ui kit
React CSS Modules - Seamless mapping of class names to CSS modules inside of React components.
primeng - The Most Complete Angular UI Component Library