Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a54acb6
feat(tooltip): add pf-v6-tooltip element
bennypowers May 11, 2026
9b4ef11
feat(tooltip): delete pf-v5-tooltip
bennypowers May 12, 2026
d7952f8
fix: update v5 tooltip importers to use pf-v6-tooltip
bennypowers May 12, 2026
d43fbaa
fix: update remaining pf-v5-tooltip references in docs and CSS
bennypowers May 12, 2026
9142b9f
feat(tooltip): add `visible` boolean
bennypowers May 14, 2026
f60ce1a
docs(tooltip): add README.md
bennypowers May 14, 2026
7fab4c8
fix(tooltip): a11y and API improvements
bennypowers May 26, 2026
9c6a816
test(tooltip): add missing test coverage
bennypowers May 26, 2026
363d090
feat(tooltip): add click and manual trigger demos
bennypowers May 26, 2026
da02eb1
chore(tooltip): remove redundant left-aligned demo
bennypowers May 26, 2026
0aa92e1
docs: update ADVICE.md with announcer and cross-root ARIA guidance
bennypowers May 26, 2026
91c3198
chore(tooltip): add changeset
bennypowers May 26, 2026
3ce0687
fix: address review
bennypowers Jun 14, 2026
9e82d97
test: cover a11y cases
bennypowers Jun 14, 2026
df58829
Merge branch 'staging/pfv6' into feat/tooltip/v6
bennypowers Jun 15, 2026
6d2dd74
Merge branch 'staging/pfv6' into feat/tooltip/v6
bennypowers Jun 15, 2026
153da78
fix(tooltip): early bail if opposite action called while await
zeroedin Jul 9, 2026
727160e
chore: bad merge correction
zeroedin Jul 9, 2026
df1bbfa
fix(tooltip): support svg or mathml element as a trigger
zeroedin Jul 9, 2026
71b4f51
fix(tooltip): avoid double invocation
zeroedin Jul 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .changeset/keen-newts-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
"@patternfly/elements": major
---

Added `<pf-v6-tooltip>` replacing `<pf-v5-tooltip>`. Tooltip now follows
PatternFly v6 design specs.

```html
<pf-v6-tooltip content="Copy to clipboard">
<button>Copy</button>
</pf-v6-tooltip>
```

**Breaking changes from v5:**

- Tag name changed from `pf-v5-tooltip` to `pf-v6-tooltip`
- `visible` attribute replaces programmatic-only visibility
- `entry-delay` and `exit-delay` attributes added (300ms default)
- `alignment` attribute replaces `isContentLeftAligned` (accepts `start`/`end`)
- `no-flip` inverted boolean replaces `enableFlip`
- `content` slot added for rich HTML content
- Cancelable `show`/`hide` events with `reason` property
- `silent` attribute for suppressing screen reader announcements
- CSS custom properties replace inline style props (`maxWidth`, etc.)

Users who need the react component's `trigger` prop are advised to use `<pf-v6-popover>` instead, or to use the cancellable `show`/`hide` events to prevent default behaviour.
7 changes: 6 additions & 1 deletion .claude/ADVICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,13 @@ Icons are decorative or informational, not interactive. Click handlers belong on

> "You must not add click listeners to icons." (PFE PR #2951)

### Use a static live-region announcer for tooltip/popover content
Tooltip and popover content lives in shadow DOM, which prevents `aria-describedby` from working cross-root. Use a shared static `role="status"` announcer element (visually hidden, appended to `document.body`) to announce content to screen readers. Announce on show, clear on hide. Provide a `silent` boolean attribute to opt out when authors provide their own accessible label.

> Pattern established in `rh-tooltip` (RHDS): static `initAnnouncer()` + `announce(text)` in `show()`, clear in `hide()`. Adopted in `pf-v6-tooltip` (PFE).

### Consider cross-root ARIA limitations
When composing elements across shadow boundaries, cross-root ARIA references don't work declaratively yet. This may require duplicating internal elements as a workaround. Client-side, ARIA IDL DOM properties (baseline 2025) can resolve cross-root references imperatively via JavaScript. Upcoming APIs like Reference Target will provide declarative solutions.
When composing elements across shadow boundaries, cross-root ARIA references don't work declaratively yet. `ariaDescribedByElements` and similar IDL properties silently fail for light-to-shadow references. The [WPT test](https://github.com/web-platform-tests/wpt/blob/master/custom-elements/element-internals-aria-element-reflection.html) explicitly asserts cross-root refs produce an empty computed label. See also [WICG/aom#192](https://github.com/WICG/aom/issues/192) and [whatwg/html#5401](https://github.com/whatwg/html/issues/5401). Upcoming APIs like Reference Target ([WICG/webcomponents#1086](https://github.com/WICG/webcomponents/issues/1086)) will provide solutions. Keep cross-root IDL assignments as progressive enhancement.

> "We can't use pf-button until browser vendors ship a solution for x-root aria." (PFE PR #2676)

Expand Down
6 changes: 3 additions & 3 deletions docs/framework-integration/react.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ tags:
import { Card } from "@patternfly/elements/react/pf-v5-card/pf-v5-card.js";
import { Switch } from "@patternfly/elements/react/pf-v6-switch/pf-v6-switch.js";
import { Popover } from "@patternfly/elements/react/pf-v5-popover/pf-v5-popover.js";
import { Tooltip } from "@patternfly/elements/react/pf-v5-tooltip/pf-v5-tooltip.js";
import { Tooltip } from "@patternfly/elements/react/pf-v6-tooltip/pf-v6-tooltip.js";

import "./App.css";
```
Expand Down Expand Up @@ -208,7 +208,7 @@ tags:
### Tooltip

Now we have a card, button, and switch component, let's add
[`pf-v5-tooltip`][pf-v5-tooltip] web component in our app. We will show the tooltip
[`pf-v6-tooltip`][pf-v6-tooltip] web component in our app. We will show the tooltip
text on mouseover.

```js
Expand Down Expand Up @@ -356,7 +356,7 @@ tags:
[pf-v5-button]: https://patternflyelements.org/components/button/
[pf-v5-card]: https://patternflyelements.org/components/card/
[pf-v6-switch]: https://patternflyelements.org/components/switch/
[pf-v5-tooltip]: https://patternflyelements.org/components/tooltip/
[pf-v6-tooltip]: https://patternflyelements.org/components/tooltip/
[pf-v5-popover]: https://patternflyelements.org/components/popover/
[inng]: https://medium.com/patternfly-elements/using-patternfly-elements-web-components-in-your-angular-app-4b18b1c9c363
[invue]: https://patternflyelements.org/framework-integration/vue/
6 changes: 3 additions & 3 deletions elements/pf-v5-chip/demo/long-chip-with-tooltip.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<pf-v5-tooltip>
<pf-v6-tooltip>
<pf-v5-chip id="longchip">Really long chip that goes on and on</pf-v5-chip>
<span slot="content">Really long chip that goes on and on</span>
</pf-v5-tooltip>
</pf-v6-tooltip>

<style>
#longchip::part(text) {
Expand All @@ -16,6 +16,6 @@

<script type="module">
import '@patternfly/elements/pf-v5-chip/pf-v5-chip.js';
import '@patternfly/elements/pf-v5-tooltip/pf-v5-tooltip.js';
import '@patternfly/elements/pf-v6-tooltip/pf-v6-tooltip.js';
</script>

6 changes: 3 additions & 3 deletions elements/pf-v5-chip/docs/pf-v5-chip.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script type="module">
import '@patternfly/elements/pf-v5-icon/pf-v5-icon.js';
import '@patternfly/elements/pf-v6-badge/pf-v6-badge.js';
import '@patternfly/elements/pf-v5-tooltip/pf-v5-tooltip.js';
import '@patternfly/elements/pf-v6-tooltip/pf-v6-tooltip.js';
</script>

{% renderOverview %}
Expand Down Expand Up @@ -36,12 +36,12 @@ Chips can be removable or read-only. The Overflow chip is a special chip that is
#### Max-width

{% htmlexample %}
<pf-v5-tooltip id="max"
<pf-v6-tooltip id="max"
position="top">
<pf-v5-chip onclick="this.parentElement.remove()"
style="max-width:10em;">Really long chip that goes on and on</pf-v5-chip>
<span slot="content">Really long chip that goes on and on</span>
</pf-v5-tooltip>
</pf-v6-tooltip>
{% endhtmlexample %}

### Chip group
Expand Down
6 changes: 3 additions & 3 deletions elements/pf-v5-clipboard-copy/pf-v5-clipboard-copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import formControlStyles from '../form-control.css';

import '@patternfly/elements/pf-v5-button/pf-v5-button.js';
import '@patternfly/elements/pf-v5-icon/pf-v5-icon.js';
import '@patternfly/elements/pf-v5-tooltip/pf-v5-tooltip.js';
import '@patternfly/elements/pf-v6-tooltip/pf-v6-tooltip.js';

const sleep = (ms?: number) => new Promise(r => setTimeout(r, ms));

Expand Down Expand Up @@ -112,7 +112,7 @@ export class PfV5ClipboardCopy extends LitElement {
?disabled="${expanded || readonly}"
.value="${this.value}"
@input="${this.#onChange}">
<pf-v5-tooltip>
<pf-v6-tooltip>
<pf-v5-button id="copy-button"
icon="copy"
?plain="${inline || compact}"
Expand All @@ -121,7 +121,7 @@ export class PfV5ClipboardCopy extends LitElement {
@click="${this.copy}">
</pf-v5-button>
<span slot="content">${this.#copied ? this.clickTip : this.hoverTip}</span>
</pf-v5-tooltip>
</pf-v6-tooltip>
<!-- Place additional action buttons here -->
<slot name="actions"></slot>
</div>
Expand Down
2 changes: 1 addition & 1 deletion elements/pf-v5-icon/demo/sets.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h1>Default Icon Sets</h1>

<script type="module">
import '@patternfly/elements/pf-v5-icon/pf-v5-icon.js';
import '@patternfly/elements/pf-v5-tooltip/pf-v5-tooltip.js';
import '@patternfly/elements/pf-v6-tooltip/pf-v6-tooltip.js';

import { render, html } from 'lit';
import { repeat } from 'lit/directives/repeat.js';
Expand Down
64 changes: 0 additions & 64 deletions elements/pf-v5-tooltip/README.md

This file was deleted.

60 changes: 0 additions & 60 deletions elements/pf-v5-tooltip/demo/block-triggers.html

This file was deleted.

60 changes: 0 additions & 60 deletions elements/pf-v5-tooltip/demo/custom-styles.html

This file was deleted.

Loading
Loading