Typed React list components: <Ul>
, <Ol>
, <Li>
, <Dl>
, <Dt>
, <Dd>
.
Works with React 18 and React 19 (types are provided by your app).
pnpm add react-lists # or npm i / yarn add
Peer deps:
react
and (optionally)react-dom
>=18 <20
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>
);
}
- 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.
To run the example locally:
cd example
npm install
npm run dev
MIT