找到準確的元件契約
找到元件,查看其精確 API。
公開目錄、結構化 API 索引、分冊參考資料和 MCP 搜尋提供元件屬性、事件、插槽、依賴與遷移指南,讓程式設計AI 智能體在編寫標記前先查閱明確的契約。
範例
搜尋元件,然後閱讀其確切的 API。
const origin = 'https://www.lyra-ui.com/api/v1/components';
const search = await fetch(origin + '/search?q=combobox');
if (!search.ok) throw new Error('Component search failed');
const { matches } = await search.json();
const tag = matches[0]?.tag;
if (tag) {
const response = await fetch(origin + '/' + encodeURIComponent(tag));
if (!response.ok) throw new Error('Component reference failed');
const reference = await response.json();
console.log(reference.markdown);
}