Epicenter
Local-first, open source apps
Suggestion is a prompt you send without typing. Each one is a Button with the prompt as its label. Put a row of them above the Prompt Input.
Installation
Suggestion is built with the Button component.
Usage
<script lang="ts">
import { Button } from "$lib/components/ui/button/index.js";
</script> <div
class="scrollbar-none flex scroll-fade-x gap-2 overflow-x-auto overscroll-x-contain"
>
{#each suggestions as suggestion, index (index)}
<Button
variant="outline"
size="sm"
class="shrink-0"
onclick={() => send(suggestion)}
>
{suggestion}
</Button>
{/each}
</div> Scrolling
The row scrolls sideways when the suggestions do not fit. scroll-fade-x fades the edge that has more to show, and shrink-0 keeps each label on one line.
AI SDK
The label is the message. Send it as is.
chat.sendMessage({ text: suggestion });