aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/atoms/lists/list.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/atoms/lists/list.tsx')
-rw-r--r--src/components/atoms/lists/list.tsx11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/components/atoms/lists/list.tsx b/src/components/atoms/lists/list.tsx
index 74ab8b0..d100a31 100644
--- a/src/components/atoms/lists/list.tsx
+++ b/src/components/atoms/lists/list.tsx
@@ -18,7 +18,7 @@ export type ListItem = {
export type ListProps = {
/**
- * Set additional classnames to the list wrapper
+ * Set additional classnames to the list wrapper.
*/
className?: string;
/**
@@ -26,6 +26,10 @@ export type ListProps = {
*/
items: ListItem[];
/**
+ * Set additional classnames to the list items.
+ */
+ itemsClassName?: string;
+ /**
* The list kind (ordered or unordered).
*/
kind?: 'ordered' | 'unordered';
@@ -41,8 +45,9 @@ export type ListProps = {
* Render either an ordered or an unordered list.
*/
const List: VFC<ListProps> = ({
- className,
+ className = '',
items,
+ itemsClassName = '',
kind = 'unordered',
withMargin = true,
}) => {
@@ -57,7 +62,7 @@ const List: VFC<ListProps> = ({
*/
const getItems = (array: ListItem[]): JSX.Element[] => {
return array.map(({ child, id, value }) => (
- <li key={id} className={styles.list__item}>
+ <li key={id} className={`${styles.list__item} ${itemsClassName}`}>
{value}
{child && (
<ListTag