@yozora/react-list
This component is for rendering the List data produced by
@yozora/tokenizer-list.
This component has been built into @yozora/react-markdown, you can use it directly.
Install
-
npm
npm install --save @yozora/react-list
-
yarn
yarn add @yozora/react-list
Usage
-
Basic:
import React from 'react' import List from '@yozora/react-list' import ListItem from '@yozora/react-list-item' import '@yozora/react-list/lib/esm/index.css' const wrapper = ( <List ordered={ true } start={ 3 } type="a"> <ListItem key={ 0 }>apple</ListItem> <ListItem key={ 1 }>banana</ListItem> <ListItem key={ 2 }>cat</ListItem> </List> )
Props
Name | Type | Required | Default | Description |
---|---|---|---|---|
children |
React.ReactNode |
false |
- | List items |
className |
string |
false |
- | Root css class |
ordered |
boolean |
true |
- | Indicate an ordered list |
start |
number |
false |
- | Start number of ordered list |
style |
React.CSSProperties |
false |
- | Root css style |
-
className
: The root element of this component will always bind with the CSS class'yozora-list'
Related
- @yozora/ast
- @yozora/react-markdown
- @yozora/tokenizer-list
- @yozora/tokenizer-list-item
- [Paragraph | Mdast][mdast]