Socket
Book a DemoInstallSign in
Socket

@emotion/is-prop-valid

Package Overview
Dependencies
Maintainers
4
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@emotion/is-prop-valid

A function to check whether a prop is valid for HTML and SVG elements

latest
Source
npmnpm
Version
1.4.0
Version published
Weekly downloads
14M
-18.51%
Maintainers
4
Weekly downloads
 
Created

What is @emotion/is-prop-valid?

The @emotion/is-prop-valid package is a utility for checking if a given property is a valid HTML or SVG attribute. It is commonly used in CSS-in-JS libraries, such as Emotion, to filter out props that should not be passed to DOM elements to avoid React warnings about unknown DOM props.

What are @emotion/is-prop-valid's main functionalities?

Checking HTML validity of a prop

This feature allows you to check if a prop is a valid HTML attribute. It returns true for valid attributes like 'onClick' and false for non-standard or invalid attributes like 'randomPropName'.

import isPropValid from '@emotion/is-prop-valid';

console.log(isPropValid('onClick')); // true
console.log(isPropValid('randomPropName')); // false

Checking SVG validity of a prop

This feature allows you to check if a prop is a valid SVG attribute. It returns true for valid attributes like 'viewBox' and false for non-standard or invalid attributes like 'randomSVGProp'.

import isPropValid from '@emotion/is-prop-valid';

console.log(isPropValid('viewBox')); // true
console.log(isPropValid('randomSVGProp')); // false

Other packages similar to @emotion/is-prop-valid

FAQs

Package last updated on 04 Sep 2025

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