Socket
Socket
Sign inDemoInstall

@s-ui/react-primitive-polymorphic-element

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @s-ui/react-primitive-polymorphic-element

> Render a basic polymorphic element capable of rendering a specified html tag or component when passed as a property.


Version published
Weekly downloads
2.8K
increased by45.61%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

PolymorphicElement

Render a basic polymorphic element capable of rendering a specified html tag or component when passed as a property.

Installation

$ npm install @s-ui/react-primitive-polymorphic-element

Usage

Basic usage

Import package and use the component
import PolymorphicElement from 'components/primitive/polymorphicElement/lib/index.js'

function Component() {}

return (
<>
  <PolymorphicElement as="div"/>
  <PolymorphicElement as="h1"/>
  <PolymorphicElement as={Component}/>
</>
)

Properties

PropertyTypeDefaultDescription
asstring | function'span'Render the passed value as the correspondent HTML tag or the component if a function is passed.

Find full description and more examples in the demo page.

FAQs

Last updated on 23 Jun 2022

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