Opengist

Explore

  • All gists
  • Topics
  • Users
Give feedback on the new UI Powered by Opengist ⋅ 13ms

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Login
r

react-utility

Recently created Least recently created Recently updated Least recently updated
William-Owen

William-Owen / CN - React Class Name composeor

Last active 2 months ago react-utility

This is a react utility to concatenate class names, including the ability to support conditional class names

0 0 3
1 type Argument = string | boolean | null | undefined | number
2
3 /**
4 *
5 * Combines multiple class name arguments, automatically filtering out falsy values
6 * (false, null, undefined) and normalizing any extra whitespace within or between
7 * class names. Supports conditionally joining class names into a single string.
8 *
9 * @param args - Class name strings or conditional expressions that resolve to strings/booleans
10 * @returns A single normalized class name string with no extra whitespace