Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/classnames

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/classnames

Stub TypeScript definitions entry for classnames, which provides its own types definitions

  • 2.3.4
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1M
increased by1.77%
Maintainers
1
Weekly downloads
 
Created

What is @types/classnames?

The @types/classnames package provides TypeScript type definitions for the classnames library, which is a utility for conditionally joining classNames together. This package is useful for TypeScript users who want to ensure type safety when using classnames to dynamically generate class strings based on certain conditions.

What are @types/classnames's main functionalities?

Basic usage with strings

Combine multiple class names into a single string.

classNames('foo', 'bar'); // 'foo bar'

Using objects to conditionally apply classes

Apply classes based on the truthiness of the associated value.

classNames({ 'foo': true, 'bar': false }); // 'foo'

Combining types

Mix strings and objects to conditionally apply classes.

classNames('foo', { 'bar': true }, 'baz', { 'qux': false }); // 'foo bar baz'

Using arrays

Pass arrays of class names to be joined together.

classNames(['foo', 'bar'], ['baz']); // 'foo bar baz'

Other packages similar to @types/classnames

FAQs

Package last updated on 23 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc