# Suggestion Chips

> Prompts to start from, or follow-up questions after an answer.

```tsx
'use client';

import { useState } from 'react';
import { SuggestionChips } from '@brand-studio/ui';

export default function SuggestionChipsDemo() {
  const [asked, setAsked] = useState<string>();
  return (
    <div style={{ width: '100%', maxWidth: 520, display: 'grid', gap: 16, textAlign: 'center', justifyItems: 'center' }}>
      <h3 style={{ margin: 0, fontSize: 22 }}>{asked ?? 'What are we brewing today?'}</h3>
      <SuggestionChips
        key={asked}
        label={asked ? 'Follow-up questions' : 'Ways to start'}
        suggestions={asked ? ['Why that grind size?', 'What if I only have a French press?', 'Save this recipe'] : ['Dial in a new bag', 'Which beans are ready?', 'Plan this week’s roasts', 'Write tasting notes']}
        onSelect={setAsked}
      />
    </div>
  );
}
```

## Installation

```sh
npm install @brand-studio/ui
```

React 18 or 19 is a peer dependency. Import the stylesheet once and wrap the app in a brand theme:

```tsx
import '@brand-studio/ui/styles.css';
import { BrandTheme, SuggestionChips } from '@brand-studio/ui';
import brand from './brand.json';

<BrandTheme palette={brand.tokens} mode="system">
  {/* your app */}
</BrandTheme>
```

## Usage

```tsx
import { SuggestionChips } from '@brand-studio/ui';
```

```tsx
<SuggestionChips
  label="Follow-up questions"
  suggestions={['Why that grind size?', 'Save this recipe']}
  onSelect={ask}
/>
```

The chips arrive one after another. Change the component's `key` to play the entrance again for a new set.

## Accessibility

- The chips are a list of buttons named by `label`.
- With reduced motion they show at once.

## API Reference

| Prop | Type | Default |
|---|---|---|
| `suggestions` | `string[]` | – |
| `onSelect?` | `((suggestion: string) => void)` | – |
| `label?` | `string` | `'Suggestions'` |
| `className?` | `string` | `''` |

Source: https://brandstudio.js.org/docs/components/suggestion-chips/
