Skip to content

Commit

Permalink
feat(list): add className prop forwarding to List and ListItem (#204)
Browse files Browse the repository at this point in the history
* feat(list): add className prop forwarding to List and ListItem

* Update src/list/List.tsx

Co-authored-by: Mikyo King <mikyo@arize.com>

* Update src/list/List.tsx

Co-authored-by: Mikyo King <mikyo@arize.com>

---------

Co-authored-by: Mikyo King <mikyo@arize.com>
  • Loading branch information
bbleungg and mikeldking committed May 7, 2024
1 parent 78b1458 commit bc31c7e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/list/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,18 @@ export interface ListProps extends HTMLProps<HTMLUListElement> {
* @default false
*/
interactive?: boolean;
className?: string;
}
export function List({
children,
listSize = 'default',
interactive = false,
noPadding = false,
className,
}: ListProps) {
return (
<ul
className="ac-list"
className={`ac-list${className ? ` ${className}` : ''}`}
css={css(
css`
list-style: none;
Expand Down Expand Up @@ -88,6 +90,7 @@ export interface ListItemProps extends HTMLProps<HTMLLIElement> {
* @default true
*/
interactive?: boolean;
className?: string;
}

const listItemCSS = (options: {
Expand Down Expand Up @@ -126,11 +129,14 @@ export function ListItem({
listSize = 'default',
noPadding = false,
interactive = false,
className,
onClick,
}: ListItemProps) {
return (
<li
className="ac-list-item"
className={`ac-list-item${
className ? ` ${className}` : ''
}`}
css={listItemCSS({ listSize, noPadding, interactive })}
onClick={onClick}
>
Expand Down

0 comments on commit bc31c7e

Please sign in to comment.