Skip to content

Commit

Permalink
feat(tooltip): expose defaultOpen prop (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekv24 authored Apr 25, 2024
1 parent 1e83602 commit 510aa28
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/apsara-ui/src/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@ export type TooltipProps = {
title?: React.ReactNode | RenderFunction | string;
placement?: TooltipPlacement;
style?: React.CSSProperties;
defaultOpen?: boolean;
} & HTMLAttributes<HTMLDivElement>;

const Tooltip = ({
title = "",
placement = "right",
style = { backgroundColor: "#333", color: "white" },
children,
defaultOpen = false,
...props
}: TooltipProps) => {
return (
<RadixTooltip.Provider delayDuration={100}>
<RadixTooltip.Root>
<RadixTooltip.Root defaultOpen={defaultOpen}>
<RadixTooltip.Trigger asChild>
<span>{children}</span>
</RadixTooltip.Trigger>
Expand Down

0 comments on commit 510aa28

Please sign in to comment.