State Triggers Overview
State Triggers let you change the quick-action chips your widget shows based on the page the user is on. Define a URL pattern, attach a list of chips, and the widget surfaces those chips whenever the user navigates to a matching URL.
How State Triggers work
Section titled “How State Triggers work”Each State Trigger has three parts:
- URL pattern — A glob pattern matched against the current page URL (e.g.,
/settings/billing,/checkout/*). - Chips — The set of quick-action prompts the widget should display when the pattern matches.
- Widget — The widget the trigger applies to.
When a user navigates to a page matching the pattern, the widget swaps its default chips for the trigger’s chips. As the user moves to a different page, the widget either applies a different trigger’s chips or falls back to the widget defaults.
Common use cases
Section titled “Common use cases”- Page-specific prompts — Show “Why was I charged twice?” on
/settings/billing, show “How do I reset my password?” on/account/security. - Funnel coaching — On
/checkout/*, suggest prompts that address common pre-purchase questions. - Feature-area help — On a complex settings page, surface chips that map to the most-asked questions for that surface.
Pattern matching
Section titled “Pattern matching”Patterns use a simple glob syntax:
| Pattern | Matches |
|---|---|
/settings | Only the exact /settings page |
/settings/* | Any page directly under /settings/ (e.g., /settings/profile) |
/docs/*/getting-started | Any getting-started page under a docs subsection |
The most specific matching trigger wins when multiple patterns overlap.
Difference from Guides
Section titled “Difference from Guides”State Triggers swap chips (short prompts the user can tap). Guides are full video walkthroughs the user can step through. Use State Triggers for short contextual prompts; use Guides for end-to-end task instruction.