Interlock list component
This component inherits all params of the Box component
List props
🔗 items ▪️ listItemBoxProps ▪️ variant
interface ListItemProps {
key: string | number;
children: string | React.ReactNode | React.ReactNode[];
}
interface ListProps extends BoxProps {
items?: ListItemProps[];
listItemBoxProps?: BoxProps;
variant?: "markers" | "borders" | "noformat";
}
const items = [{ key: 'test_item1', children: <span>Test item 1</span>},
{ key: 'test_item2', children: <span>Test item 2</span>},
{ key: 'test_item1', children: <span>Test item 3</span>}]
<>
<List items={items} />
</>
Rendered output
<>
<List items={items} listItemBoxProps={{ margin: 'small' }} />
</>
Rendered output
<>
<List items={items} variant="markers" />
<List items={items} variant="borders" />
<List items={items} variant="noformat" />
</>
Rendered outputTest item 1
Test item 2
Test item 3
Test item 1
Test item 2
Test item 3