![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
emotion-styled-components
Advanced tools
A styled function with automatic filtering of non-standard attributes for your components.
A styled
function with automatic filtering of non-standard attributes base on @emotion/styled
package.
emotion-styled-components
is the result of thinking about how we could improve the forwarding of props for the @emotion/styled
system. In one of our projects, we used the styled-components
system, where the forwarding of props was provided out of the box, so when we switched to @emotion/styled
, we encountered a problem when some components issued warnings: "Invalid attribute name", and tried to solve this problem. By focusing on the use case of styled-components
, we managed to solve this problem.
To use this package you must have installed emotion package
# with npm
npm install --save emotion-styled-components @emotion/styled
# with yarn
yarn add emotion-styled-components @emotion/styled
import styled from 'emotion-styled-components';
const Button = styled(MyButton)<{ $primary?: boolean; }>`
background: ${props => props.$primary ? "#BF4F74" : "white"};
color: ${props => props.$primary ? "white" : "#BF4F74"};
`;
render(
<div>
<Button>Normal</Button>
<Button $primary>Primary</Button>
</div>
);
It also supports all functions coming from emotion by default
See more on emotion
Please read through our contributing guidelines. Included are directions for opening issues, coding standards, and notes on development.
Code released under the MIT License.
FAQs
A styled function with automatic filtering of non-standard attributes for your components.
The npm package emotion-styled-components receives a total of 37 weekly downloads. As such, emotion-styled-components popularity was classified as not popular.
We found that emotion-styled-components demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.