List view
Understanding Nobi
Understanding Nobi
Getting Started
Getting Started
Implementing Nobi
Implementing Nobi
Knowledge Base
Knowledge Base
Merchandising
Merchandising
Custom Actions
Custom Actions
Query Overrides
Query Overrides
Plans And Billing
Plans And Billing
Developers Guide
Developers Guide
Beta Products
Beta Products
References
References
Suggestion Pills
Preview (try it below):
What it is
A drop-in entry point that shows LLM-generated suggestion pills. Each pill is a contextual nudge relevant to the page the visitor is on. Pills are typed (e.g., "cross-sell" for product discovery, "qa" for answering questions) and adapt to any business vertical. You can specify which pill types to generate using the pill-types attribute, or let the AI auto-classify each pill.
- Default carousel: Prompts sit in a single row with caret icons so visitors can page through pills without breaking the page layout.
- Multi-row grid: When space allows, the pills can wrap into multiple rows (no carousel), presenting more prompts without interaction.
When to use
- Detail pages where you already surface Nobi recommendations and want a lightweight entry point higher on the page.
- On the homepage near the hero, to increase engagement
Basic usage
- Install the primary Nobi script (see the Quick Start guide).
- Place the custom element where you want the pills to render:
<!-- Default: 3 carousel pills --> <nobi-suggestion-pills pill-count="3"></nobi-suggestion-pills> <!-- Multi-row example with up to 6 pills --> <nobi-suggestion-pills pill-count="6" multi-row="true"></nobi-suggestion-pills> <!-- Specify pill types (comma-separated) --> <nobi-suggestion-pills pill-count="3" pill-types="cross-sell,qa"></nobi-suggestion-pills> <!-- Explicit product ID (optional — auto-detected on most platforms) --> <nobi-suggestion-pills pill-count="3" product-id="YOUR_PRODUCT_ID"></nobi-suggestion-pills>
The component automatically gathers page context (product ID if present, page title, URL, and meta description) and requests the appropriate pills.
Configuration options
Attribute | Type | Default | Description |
pill-count | number (1–10) | 3 | Controls how many pills the component requests. |
multi-row | true | false | false | When true, pills render in a wrapped flex grid with no carousel controls. Any truthy value enables the multi-line layout; omit the attribute or set it to false for the single-row carousel. |
pill-types | string (comma-separated slugs) | (none) | Comma-separated list of pill type slugs to request (e.g., "cross-sell,qa"). Well-known types: cross-sell (complementary products), qa (answerable questions). Custom slugs are also accepted. When omitted, the AI auto-classifies each pill. |
product-id | string | (auto-detected) | The product ID for context. On Shopify, this is auto-detected from the page. Use this attribute to explicitly set it on non-Shopify platforms or when auto-detection doesn't apply. |
Layout modes
- Single row (default): Pills are rendered inside the assistant carousel, so horizontal swipes/taps reveal the remaining prompts even in tight page layouts.
- Multi-row: Pills wrap using flexbox and respect
-nobi-suggestion-pills-gap. Use this when you have space and want every prompt visible at once.
Click behavior & page integration
Clicking a pill opens the assistant and sends a relevant message or search request to Nobi’s backend.
Analytics & events
- Suggestion Pills Container Viewed — fired once when the container reaches 25% viewport visibility. Payload includes
entryPoint,merchantId, andproductInternalId.
Custom Instruction Followups Viewed— fired per pill when a new set renders. IncludespillTextandpillType.
- Click Custom Pill — fired on click with pillText, pillType, productInternalId, and EntryPoint.SuggestionPills.
Styling
CSS Custom Properties
Override these on
:root, .nobi-suggestion-pills-container, or a scoped wrapper to match your design system.Variable | Default | Description |
-nobi-suggestion-pills-container-margin | 1em 0 | The margin for the pills container. |
--nobi-suggestion-pill-background | #E6EDFDBF | Pill background color. |
--nobi-suggestion-pill-text-color | #0C2752 | Text color in the idle state. |
--nobi-suggestion-pill-border | none | Full border declaration ( 1px solid #...). |
--nobi-suggestion-pill-border-radius | 20px | Radius for chip edges. |
--nobi-suggestion-pill-padding | 8px 22px | Inner padding for the button. |
--nobi-suggestion-pill-font-size | 0.89em | Base font size for pill labels. |
--nobi-suggestion-pill-font-family | inherit | Font family override. |
--nobi-suggestion-pill-hover-background | #d2dcf3 | Hover/focus background. |
--nobi-suggestion-pill-hover-text-color | #0C2752 | Hover/focus text color. |
--nobi-suggestion-pill-icon-color | #0C2752 | Color for the sparkle icon. |
--nobi-suggestion-pills-heading-color | inherit | Heading color when the component is embedded inside panels that supply a heading. |
--nobi-suggestion-pills-heading-font-size | inherit | Heading font size. |
--nobi-suggestion-pills-heading-font-family | inherit | Heading font family. |
--nobi-suggestion-pills-gap | 8px | Horizontal/vertical gap between pills (carousel and grid). |
Public CSS classes
.nobi-suggestion-pills-container– wraps the heading + pill region. Useful for margins or layout tweaks.
.nobi-suggestion-pill– applied to each pill button. Pair with.nobi-suggestion-pill:hoverfor hover states.
.nobi-suggestion-pill:hover– target hover/focus styles when you want more control than the CSS variables provide.
.nobi-suggestion-pill-icon– targets the leading sparkle icon.
Example overrides
:root { --nobi-suggestion-pill-background: #fff; --nobi-suggestion-pill-text-color: #212121; --nobi-suggestion-pill-border: 1px solid #e0e0e0; --nobi-suggestion-pill-hover-background: #212121; --nobi-suggestion-pill-hover-text-color: #fff; --nobi-suggestion-pill-icon-color: #ff6b35; --nobi-suggestion-pills-gap: 12px; } .product-media .nobi-suggestion-pills-container { margin-top: 1rem; justify-content: flex-start; }
Troubleshooting
- No pills rendering: The cache may not have been primed yet. The first time pills are requested on a page, the system generates them (this can take a few seconds). Subsequent requests use cached results.
- Pills expanding width of parent: The suggestion pills container will take up the full width allotted to it. You can constrain its width by setting an explicit
widthormax-widthon thenobi-suggestion-pills-containerclass, or by setting thewidthormax-widthon any of its parent elements.
Accessibility
Each pill renders as a semantic button with visible focus states, supports keyboard activation, and inherits contrast updates through the CSS variables listed above. The carousel uses standard caret buttons for navigation, and the IntersectionObserver used for analytics does not interfere with focus handling.