PromptSuggestions
Offers starter prompts that fill a PromptComposer, so an empty conversation has a clear first step.
- Frameworks
- Astro · React · Elements · Dioxus
- Registry
lumen add PromptSuggestions- Interaction
- Enhanced runtime
See it and copy it
Framework example
Choose Astro, React, Elements, or Dioxus to compare native usage against the shared visual output. Each example assumes the framework-level setup is already complete.
View PromptSuggestions code
Framework usage
Switch targets to compare the adapter code. This live preview runs the Astro example. Before copying an example, complete the matching framework setup; React, Elements, and Dioxus use their own behavior APIs.Width controls resize the preview container. Resize your browser to test viewport breakpoints.---
import { PromptComposer, PromptSuggestions, Stack } from '@santi020k/lumen-astro'
---
<Stack gap="related">
<PromptSuggestions
suggestions={[
{ label: 'Summarize the release', value: 'Summarize the changes in this release.' },
{ label: 'Find breaking changes', value: 'List the breaking changes and how to migrate each one.' },
{ label: 'Draft release notes' }
]}
target="suggestion-prompt"
/>
<PromptComposer id="suggestion-prompt" label="Ask about your project" />
</Stack>import { PromptComposer, PromptSuggestions, Stack } from '@santi020k/lumen-react'
export const Example = () => (
<>
<Stack gap="related">
<PromptSuggestions
suggestions={[
{ label: 'Summarize the release', value: 'Summarize the changes in this release.' },
{ label: 'Find breaking changes', value: 'List the breaking changes and how to migrate each one.' },
{ label: 'Draft release notes' }
]}
target="suggestion-prompt"
/>
<PromptComposer id="suggestion-prompt" label="Ask about your project" />
</Stack>
</>
)<script type="module">
import { defineLumenElements } from '@santi020k/lumen-elements/define'
defineLumenElements()
</script>
<lumen-stack gap="related">
<lumen-prompt-suggestions
suggestions='[{"label":"Summarize the release","value":"Summarize the changes in this release."},{"label":"Find breaking changes","value":"List the breaking changes and how to migrate each one."},{"label":"Draft release notes"}]'
target="suggestion-prompt"
></lumen-prompt-suggestions>
<lumen-prompt-composer id="suggestion-prompt" label="Ask about your project"></lumen-prompt-composer>
</lumen-stack>use dioxus::prelude::*;
use lumen_dioxus::prelude::*;
#[component]
fn Example() -> Element {
let mut draft = use_signal(String::new);
rsx! {
PromptSuggestions {
on_suggestion_select: move |detail: PromptSuggestionDetail| draft.set(detail.value),
suggestions: vec![
PromptSuggestion::new("Summarize").with_value("Summarize this thread"),
PromptSuggestion::new("Draft a reply"),
],
}
PromptComposer { value: draft(), on_value_change: move |text: String| draft.set(text) }
}
}Choose your target
Add this component
Choose the package for your runtime. All adapters share the Lumen stylesheet. Use the matching registry command when you want a local wrapper for that framework.
pnpm add @santi020k/lumen-astrolumen add PromptSuggestionspnpm add @santi020k/lumen-reactlumen add PromptSuggestions --target reactpnpm add @santi020k/lumen-elementslumen add PromptSuggestions --target elementsAPI reference
Lumen-specific props and runtime attributes for the Astro primitive. Use the framework differences above and the copyable examples for React composition and Elements attributes; the public adapter types define their supported contracts.
| Attribute | Values | Default | Description |
|---|---|---|---|
| suggestions | { label: string; value?: string }[] | required | Starter prompts. value defaults to label, and blank labels are skipped. Nothing renders without suggestions or children. |
| target | id | - | The id of a PromptComposer textarea or form. Choosing a suggestion fills it and moves focus to the text. |
| submitOnSelect | boolean | false | Submits the composer after filling it. Use it only for prompts that are complete. Elements uses submit-on-select. |
| disabled | boolean | false | Disables every suggestion. |
| label | string | Suggested prompts | Names the suggestion group. |
| onSuggestionSelect / ui:prompt-suggestion | { value: string } | - | React callback or cancelable runtime event. Cancel the event to handle the prompt yourself instead of filling the composer. |
| class, className | string | "" | Merges custom classes with the generated ui-* root classes. |
| ...native attributes | HTML attributes | - | Forwards standard attributes to the root element unless the component consumes them. |
Customize PromptSuggestions
Start with semantic theme tokens and a class on the public component. Keep its accessible name, focus treatment, and interaction state intact.
.product-prompt-suggestions {
--surface: 0 0% 100%;
--ink: 220 20% 15%;
--line: 220 15% 82%;
}Apply product-prompt-suggestions through Astro's class, React's className, or the custom element's class. Verify foreground and background contrast in both schemes.
| Hook | Values | Default | Contract |
|---|---|---|---|
| class, className | string | "" | Merges custom classes with the generated ui-* root classes. |
Use the documented hooks above and adapter types when targeting component states. Theme guide · Accessibility verification scope
Keyboard interactions
Keyboard behavior provided by the Astro UIPrimitives runtime for this component.
| Key | Action |
|---|---|
| Tab | Move between suggestions. |
| Enter / Space | Put the suggestion into the target composer and move focus to its text. |
Runtime events
CustomEvents dispatched by the Astro UIPrimitives runtime for this component.
| Event | Target | Detail | When |
|---|---|---|---|
| ui:prompt-suggestion | PromptSuggestions root ([data-ui-prompt-suggestions] or lumen-prompt-suggestions) | LumenPromptSuggestionDetail: { value: string } | Cancelable. Bubbles when a suggestion is chosen. Unless canceled, the prompt fills the target composer and submits it with submitOnSelect. React also calls onSuggestionSelect. |