@puntego/react/ui gives you that card as data and as replaceable components, so
you can render it with your own buttons, chips and typography while Puntego keeps
consent, confirmation, plan limits and action policy.
Release preview:@puntego/react(including@puntego/react/ui) is implemented and tested in the repository but not yet published to npm. The hosted script works today; see Install.
@puntego/react/ui is a separate entry point: apps that do not import it ship
none of it.
The card with your components
Mount the provider in headless mode, then render the card and the ask bar. Any piece you do not replace is unstyled semantic HTML.
Screen readers hear the status line from a visually hidden
role="status"
element the card keeps inside Root (it takes no space in your layout); the
answer region is announced once the answer settles. For PuntegoAskBar, pass the
same component as Submit and Stop (it receives onClick only as Stop) so
one button switches in place and keyboard focus stays on it, as in the built-in
ask bar.
Keep action labels as text: the card’s actions are labelled buttons, never icons
alone. The chips, the action labels, the AI label and error messages arrive
localized in the conversation’s language; the few words the components write
themselves (the ask bar’s placeholder and buttons, the status line) follow it too,
in English, Spanish and Portuguese.
PuntegoAnswerCard takes onEditQuestion(question) to put the question back in
your own input for the footer’s Edit question, and turn to render a
specific turn instead of the latest.
Charts and KPI tiles
An answer’s chart arrives with its layout already worked out:block.chart holds the categories, each series’ values (the
visitor-facing display, the value, and a position from 0 at the bottom to
1 at the top of the plot, or a donut part’s share), the zero line
(baseline), the gridlines (ticks) and the format the figures read in. A
metric grid’s block.metrics holds each tile’s value, limit, meter (how
full, 0 to 1), delta (direction, signed display, sentiment), change
and trend. Your chart shows exactly the scale and shares the built-in card
shows.
The default Block draws a chart with PuntegoChart and the default Fact
draws KPI tiles with PuntegoMetricTiles; both are unstyled SVG and HTML that
use --gp-accent-strong and --gp-chart-2 … --gp-chart-5 from
design tokens when you set them. To draw with your own chart
library, take the words from chartParts:
chartParts gives the one-line summary to read with the chart
(aria-describedby), every point’s accessible label (“Growth: $99.00”), the
gridline labels in the chart’s format and the same figures as a table, in
English, Spanish or Portuguese. Keep what the built-in chart keeps: one tab
stop with the arrow keys walking the points, a legend for two series, the
table for anyone who prefers it, and no motion for visitors who ask for less.
Build it from data
For full control, read the parts and render them yourself:answerCardParts(turn) is the same projection as a pure function (safe during
server rendering). runAction goes through runTurnAction: it runs only an
action the latest turn offers right now, through the built-in button’s own path,
and a write’s Do it needs a real visitor gesture — call it from the click
handler itself.
Events for your analytics
usePuntegoEvents subscribes to the guide’s public events at once and delivers
each as a versioned envelope. The contract is version 1: within it, event names
and payload fields are stable (new events and new optional fields may be added).
Read your app’s data
usePuntegoTool lets the guide read the visitor’s own data through a read-only
function of your app while the component is mounted. Only the listed fields
leave the page. See Host read tools.
Sign visitors in and out
Pass a fresh one-time token toPuntegoProvider as customerIdentityToken on
login and account switches, and clear it on logout; outside React, call
window.Puntego.setIdentity(token) and clearIdentity(). See
Frameworks.