RemixRemix
Agent surfaces

Suggestions

Suggested prompts that fill the composer for the reader to review.

Suggested prompts that fill the composer for the reader to review.

The widgets live in experimental package:remix/agent.dart, outside Remix's stability promise. Import it explicitly; package:remix/remix.dart does not export it. The registry installs editable preset recipes and their dependencies into your app. Widget, model, and styler names keep the Agent prefix. Recipe names use your app's prefix.

Install

For a new app, initialize one preset, then add the recipe and glyphs:

remix init --prefix Ui --preset fortal
remix add suggestions_recipe agent_glyphs_recipe

Existing apps keep their chosen preset. Vanilla and HeroUI provide the same recipe roles. No consumer build.yaml is needed for these Agent recipes.

Behavior

Share an AgentComposerController and, optionally, its FocusNode with the composer. Selecting an AgentSuggestion replaces the draft with its prompt and focuses the field. It does not submit. If omitted, prompt defaults to label. Suggestions are disabled while the controller is running or enabled is false.

Use the recipe

This example assumes prefix Ui and the installed UiTheme above the widget. Wrap the conversation in AgentGlyphs(builder: uiAgentGlyph, child: ...) to draw preset glyphs.

import 'package:flutter/widgets.dart';
import 'package:remix/agent.dart';
import 'ui/ui.dart';

Widget buildSuggestions(AgentComposerController controller) {
  final recipe = uiAgentSuggestionsRecipe();
  return AgentSuggestions(
    controller: controller,
    suggestions: const [
      AgentSuggestion(
        label: 'Review checkout',
        prompt: 'Review the checkout flow.',
      ),
    ],
    style: recipe.style,
    suggestionStyle: recipe.suggestionStyle,
  );
}

The recipe returns these unresolved styles. Pass each into its matching widget parameter; child controls resolve hover, focus, and disabled state in their own context.

Bundle fieldStyle type
styleAgentSuggestionsStyler
suggestionStyleButtonStyler

Each factory merges same-named overrides after its preset defaults. Edit the installed recipe to customize it. remix add suggestions_recipe --diff previews upstream differences. See migration for the previous registry API.

View page source on GitHub

On this page