The OL
component is used to render ordered lists, while the LI
component represents individual list items within these lists. These components together structure ordered sequences of items, such as steps in instructions, ranked items, or any series where order is important.
import React from 'react';
import { OL, LI } from '~/ui/components/Text';
export default function App() {
return (
<OL>
<LI>First step in the process</LI>
<LI>Second step with more detail</LI>
<LI>
<>
Third step with a nested list
<OL>
<LI>Nested step 1</LI>
<LI>Nested step 2</LI>
</OL>
</>
</LI>
</OL>
);
}
Third step with a nested list
Both the OL
and LI
components accept all standard HTML list attributes, enabling extensive customization and styling options.