An open API service indexing awesome lists of open source software.

https://github.com/piotr-pajak/react-html-tags

Type-safe React components for HTML tags with full TypeScript support and ref forwarding
https://github.com/piotr-pajak/react-html-tags

bun component-library components html html-tags html5 jsx jsx-components react react-components react-hooks react-typescript react19 type-safe typescript typescript-library

Last synced: 7 months ago
JSON representation

Type-safe React components for HTML tags with full TypeScript support and ref forwarding

Awesome Lists containing this project

README

          

# @olympo/react-html-tags

Type-safe React components for all HTML tags with full native attribute support.

## Overview

`@olympo/react-html-tags` provides React components that wrap standard HTML elements with complete TypeScript support. Each component accepts all native HTML attributes for its corresponding tag and supports ref forwarding to the underlying DOM element.

## Features

- **Full TypeScript Support**: All components are fully typed using `JSX.IntrinsicElements`
- **Ref Forwarding**: Access underlying DOM elements via refs
- **Native Attributes**: All standard HTML attributes are supported
- **Zero Dependencies**: Only requires React 19+ as a peer dependency
- **Tree-shakeable**: Import only what you need
- **Lightweight**: Minimal wrapper around native HTML elements

## Installation

```bash
npm install @olympo/react-html-tags
# or
yarn add @olympo/react-html-tags
# or
pnpm add @olympo/react-html-tags
# or
bun add @olympo/react-html-tags
```

## Usage

```tsx
import { Div, Button, Input, Span } from '@olympo/react-html-tags';

function MyComponent() {
const inputRef = React.useRef(null);
const [value, setValue] = React.useState('');

return (



Welcome!

setValue(e.target.value)}
placeholder="Enter text..."
className="input-field"
/>

inputRef.current?.focus()}
disabled={!value}
>
Submit


);
}
```

## Available Components

**All 110+ HTML5 elements are now supported!** 🎉

### Document Structure & Semantic Elements
``, ``, `

`, ``, ``, ``, ``, ``, ``, ``

### Headings
`

`, `

`, `

`, `

`, `

`, `
`

### Text Content & Formatting
``, `

`, ``, ``, ``, `
`, ``, ``, ``, ``, ``, ``, ``, ``, ``, ``, `

`, `


`, ``, ``, ``, ``, ``, ``, ``, ``, `