Skip to content

Latest commit

History

History
63 lines (43 loc) 路 1018 Bytes

unordered-list.md

File metadata and controls

63 lines (43 loc) 路 1018 Bytes

Unordered list

UnorderedList is used to show lists of items.

Theme | Example code

Usage

import React from 'react';
import {render, Box, Text} from 'ink';
import {UnorderedList} from '@inkjs/ui';

function Example() {
	return (
		<UnorderedList>
			<UnorderedList.Item>
				<Text>Red</Text>
			</UnorderedList.Item>

			<UnorderedList.Item>
				<Text>Green</Text>

				<UnorderedList>
					<UnorderedList.Item>
						<Text>Light</Text>
					</UnorderedList.Item>

					<UnorderedList.Item>
						<Text>Dark</Text>
					</UnorderedList.Item>
				</UnorderedList>
			</UnorderedList.Item>

			<UnorderedList.Item>
				<Text>Blue</Text>
			</UnorderedList.Item>
		</UnorderedList>
	);
}

render(<Example />);

Props

UnorderedList

children

Type: ReactNode

List items.

UnorderedList.Item

children

Type: ReactNode

List item content.