diff --git a/packages/vx-tooltip/Readme.md b/packages/vx-tooltip/Readme.md index 66092c9af..ae11eb5b0 100644 --- a/packages/vx-tooltip/Readme.md +++ b/packages/vx-tooltip/Readme.md @@ -46,14 +46,14 @@ You may override the container by specifying `containerProps` as the second argu This is a simple Tooltip container component meant to be used to actually render a Tooltip. It accepts the following props, and will spread any additional props on the tooltip container div (i.e., ...restProps): -| Name | Type | Default | Description | -| :-----------------| :--------------- | :------ | :---------------------------------------------------------------------------- | -| left | number or string | -- | Sets style.left of the tooltip container | -| top | number or string | -- | Sets style.top of the tooltip container | -| className | string | -- | Adds a class (in addition to `vx-tooltip-portal`) to the tooltip container | -| style | object | -- | Sets / overrides any styles on the tooltip container (including top and left) | -| children | node | -- | Sets the children of the tooltip, i.e., the actual content | -| withDefaultStyles | bool | true | Whether the tooltip should have default styles or not | +| Name | Type | Default | Description | +| :---------| :--------------- | :------ | :---------------------------------------------------------------------------- | +| left | number or string | -- | Sets style.left of the tooltip container | +| top | number or string | -- | Sets style.top of the tooltip container | +| className | string | -- | Adds a class (in addition to `vx-tooltip-portal`) to the tooltip container | +| style | object | -- | Sets / overrides any styles on the tooltip container (including top and left) | +| children | node | -- | Sets the children of the tooltip, i.e., the actual content | +| unstyled | bool | true | Whether the tooltip should have default styles or not | #### TooltipWithBounds diff --git a/packages/vx-tooltip/src/index.ts b/packages/vx-tooltip/src/index.ts index 2c6ba6297..38a30bd58 100644 --- a/packages/vx-tooltip/src/index.ts +++ b/packages/vx-tooltip/src/index.ts @@ -1,4 +1,4 @@ export { default as withTooltip } from './enhancers/withTooltip'; export { default as useTooltip } from './hooks/useTooltip'; -export { default as Tooltip, defaultStyles as tooltipDefaultStyles } from './tooltips/Tooltip'; +export { default as Tooltip, defaultStyles } from './tooltips/Tooltip'; export { default as TooltipWithBounds } from './tooltips/TooltipWithBounds'; diff --git a/packages/vx-tooltip/src/tooltips/Tooltip.tsx b/packages/vx-tooltip/src/tooltips/Tooltip.tsx index 568eeb93c..8f683cc7b 100644 --- a/packages/vx-tooltip/src/tooltips/Tooltip.tsx +++ b/packages/vx-tooltip/src/tooltips/Tooltip.tsx @@ -7,7 +7,7 @@ export type TooltipProps = { className?: string; style?: React.CSSProperties; children?: React.ReactNode; - withDefaultStyles?: boolean; + unstyled?: boolean; }; export const defaultStyles: React.CSSProperties = { @@ -26,20 +26,15 @@ export default function Tooltip({ className, top, left, - style, + style = defaultStyles, children, - withDefaultStyles = true, + unstyled = false, ...restProps }: TooltipProps & JSX.IntrinsicElements['div']) { return (