List
Lists allow you to display short content in a bullet-point or numbered format.
Examples
- Apples
- Oranges
- Eggs
- Milk
- Nuts
- Bolts
- Cats
- Dogs
- Black
- White
- Work
- Fun
- Oil
- Water
- First
- Last
- Wake up
- Eat breakfast
- Brush teeth
- Go to sleep
- Code
- Debug
- Cook
- Eat
- Exercise
- Shower
- Work
- Play
import React from 'react';
import ReactDOM from 'react-dom';
import { List, ListItem } from 'furl-components';
ReactDOM.render(
<div>
<List listStyle='disc'>
<ListItem>Apples</ListItem>
<ListItem>Oranges</ListItem>
<ListItem>Strawberries</ListItem>
</List>
<List
ordered
listStyle='decimal'
data={[ 'Wake up', 'Eat breakfast', 'Go to work' ]}
/>
</div>,
document.getElementById('root')
);API
| Property | Description | Type | Default | ||
|---|---|---|---|---|---|
| ordered | render ordered list | boolean | false | ||
| listStyle | list style | string | |||
| data | list data source | array(string) | |||
Notes
- You can populate a list either via passing children to it or via the use of the
dataprop. Ifdatais provided, it will take precedence over passed children, therefore rendering only the content provided indata. - A
Listonly accepts children of theListItemcomponent type. dataonly accepts an array of string values.ordereddetermines if the rendered list is an unordered list (<ul>) or an ordered list (<ol>).listStyle’s allowed values depend on the value ofordered.listStylecan be one of the following, whenorderedisfalse:'circle','disc','square','triangle','checkmark','xmark'or emtpy/undefined.listStylecan be one of the following, whenorderedistrue:'decimal','decimal-leading-zero','lower-latin','lower-roman','upper-latin','upper-roman'or emtpy/undefined.
