# @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.

Latest version **1.2.0** (published 2022-06-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install @s-ui/react-primitive-polymorphic-element
pnpm add @s-ui/react-primitive-polymorphic-element
yarn add @s-ui/react-primitive-polymorphic-element
bun add @s-ui/react-primitive-polymorphic-element
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2022-06-23 |
| First published | 2022-04-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | schibstedspain |

## Links

- npm: https://www.npmjs.com/package/@s-ui/react-primitive-polymorphic-element
- Repository: https://github.com/SUI-Components/sui-components
- Homepage: https://github.com/SUI-Components/sui-components#readme
- Issues: https://github.com/SUI-Components/sui-components/issues
- npm.io page: https://npm.io/package/@s-ui/react-primitive-polymorphic-element

## Recent versions

- 1.2.0 (latest) — 2022-06-23
- 1.2.0-beta.0 (beta) — 2024-08-12
- 1.1.0 — 2022-04-25

## README

# PolymorphicElement

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

## Installation

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

## Usage

### Basic usage

#### Import package and use the component

```js
import PolymorphicElement from 'components/primitive/polymorphicElement/lib/index.js'

function Component() {}

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

### Properties

| Property | Type | Default | Description |
|---|---|---|---|
| as | string \| 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](#).**

---
_Source: https://npm.io/package/@s-ui/react-primitive-polymorphic-element · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
