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

tailwind-styled-components

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tailwind-styled-components - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

4

dist/tailwind.d.ts

@@ -15,6 +15,6 @@ import React from "react";

<As extends IntrinsicElementsKeys>(props: P & {
$as: As;
$as?: As;
} & JSX.IntrinsicElements[As]): React.ReactElement<any> | null;
<P2 extends {}>(props: P & {
$as: React.ComponentType<P2>;
$as?: React.ComponentType<P2>;
} & NoInfer<P2>): React.ReactElement<any> | null;

@@ -21,0 +21,0 @@ }

{
"name": "tailwind-styled-components",
"version": "2.1.1",
"version": "2.1.2",
"keywords": [

@@ -5,0 +5,0 @@ "react",

@@ -234,2 +234,18 @@ # Tailwind-Styled-Component

### Polymorphic Components
If you want to keep all the styling you've applied to a component but just switch out what's being ultimately rendered (be it a different HTML tag or a different custom component), you can use the `$as` prop to do this at runtime.
```js
const Button = tw.button`inline-flex items-center p-2`
<Button $as="a" href="#">Link</Button>
```
Will render as
```html
<a href="#" class="inline-flex items-center p-2">Link</a>
```
## Example

@@ -236,0 +252,0 @@

Sorry, the diff of this file is not supported yet

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