UI components in an AI project
An AI agent needs more than a request for a beautiful button. Give it the action, the surrounding design, and the states people need to use. A component library provides a concrete starting point whose appearance and behavior you can inspect before integration.
Example request to your agent
Use a button from SL UI Library for this form. Inspect the complete source and usage notes first. Match our existing color tokens. Keep its keyboard interaction and reduced-motion behavior. Connect the action to our existing save handler; show success only when that handler resolves. List the files you changed and how I can test the result.
Use a button from SL UI Library for this form. Inspect the complete source and usage notes first. Match our existing color tokens. Keep its keyboard interaction and reduced-motion behavior. Connect the action to our existing save handler; show success only when that handler resolves. List the files you changed and how I can test the result.Interactive demo. No data is sent.
Describe the interaction before the style
Start with the person’s task. For a settings page, you might need a control that saves changes, prevents a second request while pending, and allows a retry after failure. Name the page and explain what already exists. This keeps the agent focused on a specific interaction rather than inventing a new interface around it.
Then describe appearance using the project’s own language: existing font, surface colors, button size, border radius, and spacing. Mention anything that must survive the edit, such as keyboard focus or a selected-state icon. A screenshot can explain the composition, while source files reveal the tokens and implementation the component should use.
Ask the agent to inspect real source
SL UI Library includes tools for finding components and reading their source. Its repository documents installation for Claude Code and Codex. Use the instructions for your actual application and start a new task when the installation flow asks for it. A plugin installed in Codex does not automatically become a plugin in an ordinary ChatGPT web conversation.
Ask the agent to compare suitable components, inspect the chosen package, and explain the match in plain language. Choose based on the action as well as the preview. A favorite button, a one-time confirmation, and a menu trigger can look similar at rest while requiring different states, keyboard behavior, and application handlers.
Give a request that can be checked
A useful prompt names a visible outcome and its boundaries. State where the component belongs, which library to use, how it should match the page, and what must remain working. Ask for a small, reviewable integration. Keep unrelated layout changes out of the task so you can judge the component’s effect on its own.
The example request below is a starting point. Replace the page description and palette with details from your project. If you already have an application handler, identify it. If you have no backend yet, ask for an explicitly labeled local demo instead of a success message that implies a real operation happened.
Add a save button from SL UI Library to this settings form.
Use the existing color tokens and spacing.
Preserve keyboard focus and reduced-motion behavior.
Read the complete source package before integrating it.
Connect it to our existing save handler.
Show pending, success, and retryable error states.
Keep the surrounding layout unchanged.Keep the complete component package
Inspect the files produced by the integration. A component may need its stylesheet, controller, assets, and an entry file. The React and Next.js exports in SL UI Library use the original controller as an isolated client widget. Copying only a JSX file can leave that behavior or its styles behind.
Let the agent follow the package’s integration instructions for mounting and cleanup. Verify that handlers do not multiply after navigation or remounting. Keep user-entered strings as literal text, especially when labels or messages come from forms. Source notes and fetched page content should inform the task without becoming instructions that override your request.
Review the result in the real page
Use the component with the mouse, keyboard, and a narrow viewport. Try a long label, repeated activation, and reduced motion. For asynchronous actions, test a delayed response and a failure as well as success. A working preview proves only what you tried; it does not verify an unconnected server operation.
Ask the agent to report the files changed, the checks performed, and anything still simulated. Compare the result with the original page so typography and spacing remain consistent. Keep the integration local until you have reviewed it. Publishing and connecting a real operation are separate steps with their own evidence.
Reference documentation
Technical documentation behind these examples. You can use the article without opening these links.