Skip to content

Commit 41d4d26

Browse files
authored
feat(ListItem): add tooltipProps prop (#3137)
1 parent 205ad5a commit 41d4d26

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/core/src/components/ListItem/ListItem.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import useMergeRef from "../../hooks/useMergeRef";
1919
import { ListContext } from "../List/utils/ListContext";
2020
import { ListItemComponentType as ListItemComponentTypeEnum } from "./ListItemConstants";
2121
import { type ListItemElement, type ListItemSize } from "./ListItem.types";
22+
import { type TooltipProps } from "../Tooltip/Tooltip";
2223
import styles from "./ListItem.module.scss";
2324

2425
export interface ListItemProps extends VibeComponentProps {
@@ -62,6 +63,10 @@ export interface ListItemProps extends VibeComponentProps {
6263
* The ARIA role of the list item.
6364
*/
6465
role?: AriaRole;
66+
/**
67+
* Props passed to the tooltip displayed when hovering over the text.
68+
*/
69+
tooltipProps?: Partial<TooltipProps>;
6570
}
6671

6772
const ListItem = forwardRef(
@@ -79,7 +84,8 @@ const ListItem = forwardRef(
7984
children,
8085
"aria-current": ariaCurrent,
8186
"data-testid": dataTestId,
82-
role = "option"
87+
role = "option",
88+
tooltipProps
8389
}: ListItemProps,
8490
ref: React.ForwardedRef<HTMLElement>
8591
) => {
@@ -134,6 +140,7 @@ const ListItem = forwardRef(
134140
role={role}
135141
tabIndex={tabIndex}
136142
aria-current={ariaCurrent}
143+
tooltipProps={tooltipProps}
137144
>
138145
{children}
139146
</Text>

0 commit comments

Comments
 (0)