Skip to content

dxnsav/react-lists

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-lists

Typed React list components: <Ul>, <Ol>, <Li>, <Dl>, <Dt>, <Dd>. Works with React 18 and React 19 (types are provided by your app).

Install

pnpm add react-lists    # or npm i / yarn add

Peer deps: react and (optionally) react-dom >=18 <20

Usage

import { Ul, Ol, Li, Dl, Dt, Dd } from 'react-lists';

export default function App() {
  return (
    <div>
      <Ul>
        <Li>Milk</Li>
        <Li important>Eggs</Li>
      </Ul>

      <Ol>
        <Li>First</Li>
        <Li>Second</Li>
      </Ol>

      <Dl>
        <Dt>Coffee</Dt>
        <Dd>Liquid motivation</Dd>
      </Dl>
    </div>
  );
}

Why both React 18 & 19?

  • The package does not ship React types; it relies on your project’s installed React version.
  • For React 18: you likely have @types/react installed.
  • For React 19: types ship with React; no @types/* needed.
  • We avoid pinning to either to prevent type conflicts.

Development

To run the example locally:

cd example
npm install
npm run dev

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published