Socket
Socket
Sign inDemoInstall

@types/classnames

Package Overview
Dependencies
1
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

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


Version published
Weekly downloads
1.2M
increased by3.33%
Maintainers
1
Install size
20.8 kB
Created
Weekly downloads
 

Package description

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

Readme

Source

This is a stub types definition for @types/classnames (https://github.com/JedWatson/classnames#readme).

classnames provides its own type definitions, so you don't need @types/classnames installed!

FAQs

Last updated on 20 Apr 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc