Skill library

Agent skill UI design

Ai Elements

Shape a web interface around a coherent visual direction.

  • UI design
  • UI components

Install the skill

Installation method

Run the command from your project root with Node.js and npm.

npx skills@latest add vercel/ai-elements --skill ai-elements --agent claude-code --yes

Check this file in your project.claude/skills/ai-elements/SKILL.md

Other ways to install
  • Choose an assistant interactively

    npx skills@latest add vercel/ai-elements --skill ai-elements

    Select your assistant and choose the project installation scope.

    Official instructions

The tested Skills CLI 1.10.0 requires Node.js 22.20 or later. Bring the local copy of the legacy shadcn-based AI Elements Suggestion and a chat preview. Vercel announced the old library's deprecation at the end of November 2026 and points new setups to shadcn/ui. Replaying this UI needs no model credentials.

View operation manual

What this skill helps with

  • Shape a web interface around a coherent visual direction.

Good for

  • Visual direction
Skill name
ai-elements
Scenario
Prefill a legacy chat composer from a suggestion
Deliverable
A copyable suggestion-driven local draft flow with a separately verified submit action.
Skill name
ai-elements

Define a component task with an observable result

A request with an unclear outcome

Run the CLI for everything, then send suggestions as soon as users click.

A scoped repair can use existing source, and instant sending removes the user's chance to edit the draft.

A workflow with observable results

  1. Find the copied component and composer
  2. Wire suggestion text to the local draft
  3. Prove selecting and submitting are separate

AI Elements operation manual

Use the existing copied Suggestion component to fill a draft independently from sending it.

Replace the bracketed details with your own project and target.

  1. Find the copied component and composer

    Read the actual onClick contract and the project's draft ownership.

    Prompt · Step 1
    Use ai-elements to inspect [existing legacy chat UI]. Locate the project's actual suggestion.tsx and composer with components.json and aliases. Confirm the Suggestion onClick callback receives the selected string. Identify the draft state and explicit send handler. If the registry file is absent, report it and point to the official current shadcn AI Elements migration guidance.
  2. Wire suggestion text to the local draft

    Preserve the UI contract and leave send behind explicit submission.

    Prompt · Step 2
    Use ai-elements to implement [prefill-first chat behavior] using the existing Suggestions and Suggestion components. Connect the emitted string to the editable draft, ensure the suggestion is a non-submit button when inside a form, and retain an explicit submit action. Use a local stub or counter for submit verification. Report how empty and edited draft values are handled.
  3. Prove selecting and submitting are separate

    Check keyboard selection, draft editing and one local submit.

    • Selecting a suggestion changes the editable draft.
    • Only explicit submit runs the local submission handler.
    Prompt · Step 3
    Use ai-elements to verify [local chat fixture]. Reach a suggestion by Tab, activate it, and verify the correct text appears in the draft while the submit count stays at zero. Edit the text and submit explicitly. Verify the local handler receives the edited text once, and check at the narrow width that the next suggestion can still be reached.

Find the relevant rule

Point the assistant to the installed Skill and a specific issue.

Suggestion activates the form unexpectedlyReference
Command or reference
references/suggestion.md
Examples
Inspect type=button and separate the suggestion callback from submit.
A file path from the old examples cannot resolveReference
Command or reference
SKILL.md · Troubleshooting
Examples
Find the existing component file using project aliases and current local source.
An existing project needs its missing copy restoredReference
Command or reference
Official AI Elements legacy registry
Examples
In a scratch copy, preview only the named item with `npx shadcn@4.23.1 add https://elements.ai-sdk.dev/api/registry/suggestion.json --dry-run`. Review the Button, ScrollArea and Suggestion output before applying.

AI Elements troubleshooting

Must existing copied components be migrated?

shadcn's migration guide says the copied components continue to live in each project. Use the legacy copy for a scoped repair, or review the replacement's migration prompt when changing implementations.