Components
AiWelcome
Unstable: the empty state of a new conversation, a greeting, what the assistant can see and do, then the starters and the composer. Import it from @nizivo/react/unstable/ai-welcome.
Examples
Basic
An empty conversation: a greeting, what the assistant can see, starters and the composer.
Good morning, Maya
Ask about your orders, write captions, or tag products — I can see your store and Instagram.
import type { JSX } from 'react';
import { PromptComposer } from '@nizivo/react/unstable/prompt-composer';
import { SuggestionChip, SuggestionGroup } from '@nizivo/react/unstable/suggestion-chip';
import { AiWelcome } from '@nizivo/react/unstable/ai-welcome';
export function AiWelcomeExample(): JSX.Element {
return (
<AiWelcome
style={{ maxInlineSize: 560 }}
greeting="Good morning, Maya"
description="Ask about your orders, write captions, or tag products — I can see your store and Instagram."
>
<SuggestionGroup>
<SuggestionChip>Write a product description</SuggestionChip>
<SuggestionChip>Summarise this week’s orders</SuggestionChip>
<SuggestionChip>Find slow-moving stock</SuggestionChip>
<SuggestionChip>Draft a launch post</SuggestionChip>
</SuggestionGroup>
<PromptComposer labels={{ placeholder: 'Ask Nizivo AI anything…' }} />
</AiWelcome>
);
}
Import
import { AiWelcome } from '@nizivo/react/unstable/ai-welcome';
// Once per app (Getting started), after
// @nizivo/tokens/tokens.css and @nizivo/react/css/base.css
import '@nizivo/react/css/ai-welcome.css';Static or interactive
Server. No client JavaScript of its own; its children (a PromptComposer) may have some. How to choose.
Content
greeting is the heading (headingLevel, 2 by default); description says what the assistant can
see and do. Be honest about its scope and its access to data. The children follow at full width:
a SuggestionGroup of starters and the composer.
The orb
The orb is decoration. The design's is a shader: pass GlowOrb as
orb (orb={<GlowOrb />}) and it breathes in the 72 px circle, the welcome's own halo dropped behind
it. Without it the orb is drawn with CSS, as VoiceOrb's is; orb
takes any picture in its place, hidden from assistive technology.
Props
Server component Renders data-slot="ai-welcome" with the class nz-ai-welcome. Props: AiWelcomeProps. Source: src/unstable/ai-welcome/ai-welcome.tsx.
| Name | Type | Default | Description |
|---|---|---|---|
description | ReactNode | – | What the assistant can see and do: "Ask about your orders… I can see your store and Instagram." |
greetingrequired | ReactNode | – | "Good morning, Maya". |
headingLevel | 1 | 2 | 3 | 4 | 5 | 6 | 2 | The greeting's level, so the empty state fits the page outline. |
orb | ReactNode | – | Replaces the CSS orb, for example |
render | RenderProp<Record<string, never>> | – | Must render a |
- Also takes every attribute of
<section>excepttitle. (Omit<ComponentPropsWithRef<"section">, "title">)
render takes an element, or, in client code, a function of the props and no state.
Other exports
AiWelcomePropstypeimport type { AiWelcomeProps } from '@nizivo/react/unstable/ai-welcome'The props of
AiWelcome, listed above.
Data attributes and slots
Style parts by class (.nz-<slot>) and state by data attribute. Attribute meanings come from contracts/vocabulary.json.
| Slot | Rendered by | Data attributes |
|---|---|---|
ai-welcome.nz-ai-welcome | AiWelcomeroot (takes render) | none |
ai-welcome-description.nz-ai-welcome-description | AiWelcomeinner element (CSS only) | none |
ai-welcome-greeting.nz-ai-welcome-greeting | AiWelcomeinner element (CSS only) | none |
CSS hooks
Set a hook on the component's class or any ancestor to restyle it without specificity games; leave it unset for the default shown.
This stylesheet reads no public hook.
Layers: nz.components. Classes: .nz-ai-welcome, .nz-ai-welcome-description, .nz-ai-welcome-greeting, .nz-ai-welcome-orb, .nz-ai-welcome-sphere, .nz-glow-orb.
Tokens this stylesheet reads (12)
--nz-bg-accent, --nz-bg-brand, --nz-bg-canvas, --nz-font-body-m, --nz-font-heading-h1, --nz-radius-full, --nz-space-10, --nz-space-5, --nz-space-8, --nz-text-primary, --nz-text-secondary, --nz-tracking-heading-h1
Accessibility
Nothing in this component takes focus or keyboard input.
Keyboard
None.
AiBadge
Unstable: says that the content beside it was written or changed by AI. Subtle or solid, in the lime that marks AI everywhere in Nizivo. Import it from @nizivo/react/unstable/ai-badge.
Alert
A tinted message with a title, an optional action and an optional dismiss button. Static and server-rendered unless you add the dismiss leaf.