Skip to content
Get started

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.

Server component, no client JSUnstable

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.

NameTypeDefaultDescription
descriptionReactNode–

What the assistant can see and do: "Ask about your orders… I can see your store and Instagram."

greetingrequiredReactNode–

"Good morning, Maya".

headingLevel1 | 2 | 3 | 4 | 5 | 62

The greeting's level, so the empty state fits the page outline.

orbReactNode–

Replaces the CSS orb, for example <GlowOrb />. Decorative: hidden from assistive technology.

renderRenderProp<Record<string, never>>–

Must render a <section>.

  • Also takes every attribute of <section> except title. (Omit<ComponentPropsWithRef<"section">, "title">)

render takes an element, or, in client code, a function of the props and no state.

Other exports

AiWelcomeProps type

import 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.

SlotRendered byData attributes
ai-welcome
.nz-ai-welcome
AiWelcome
root (takes render)
none
ai-welcome-description
.nz-ai-welcome-description
AiWelcome
inner element (CSS only)
none
ai-welcome-greeting
.nz-ai-welcome-greeting
AiWelcome
inner 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.

On this page