Socket
Socket
Sign inDemoInstall

@types/classnames

Package Overview
Dependencies
0
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/classnames

TypeScript definitions for classnames


Version published
Maintainers
1
Install size
5.06 kB
Created

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

Installation

npm install --save @types/classnames

Summary

This package contains type definitions for classnames (https://github.com/JedWatson/classnames).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/classnames

Additional Details

  • Last updated: Fri, 01 Jun 2018 16:26:34 GMT
  • Dependencies: none
  • Global values: classNames

Credits

These definitions were written by Dave Keen http://www.keendevelopment.ch, Adi Dahiya https://github.com/adidahiya, Jason Killian https://github.com/JKillian, Sean Kelley https://github.com/seansfkelley, Michal Adamczyk https://github.com/mradamczyk, Marvin Hagemeister https://github.com/marvinhagemeister.

FAQs

Last updated on 01 Jun 2018

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