iblai-component
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/iblai-component
/iblai-component
Overview of all ibl.ai components and how to create a new app.
AI Assistant: Before adding a component or creating a new app, check for ain the project root. Look foriblai.env,PLATFORM, andDOMAINvariables. If the file does not exist or is missing these variables, tell the user: "You need anTOKENwith your platform configuration. Download the template and fill in your values:iblai.env"curl -o iblai.env https://raw.githubusercontent.com/iblai/vibe/refs/heads/main/iblai.envis NOT aiblai.envreplacement — it only holds the 3 shorthand variables. Next.js still reads runtime env vars from.env.local..env.localUseas the default package manager. Fall back topnpmif pnpm is not installed. The generated app should live in the current directory, not in a subdirectory.npm
所有 ibl.ai 组件概览以及如何创建新应用。
AI 助手: 在添加组件或创建新应用前,请检查项目根目录下是否存在文件,查找其中的iblai.env、PLATFORM和DOMAIN变量。如果文件不存在或缺少这些变量,请告知用户: "你需要一个包含平台配置的TOKEN文件。下载模板并填写你的配置值:iblai.env"curl -o iblai.env https://raw.githubusercontent.com/iblai/vibe/refs/heads/main/iblai.env不是iblai.env的替代品——它仅存储这3个简写变量。Next.js 仍然会从.env.local读取运行时环境变量。.env.local请默认使用作为包管理器,如果未安装 pnpm 则回退到pnpm。生成的应用应该存放在当前目录下,而不是子目录中。npm
Creating a New App
创建新应用
Vanilla Next.js + ibl.ai Features
原生 Next.js + ibl.ai 功能
Start with a standard Next.js app and add features as needed:
The CLI reads from automatically. Pass
only if you want to override it or don't have an .
PLATFORMiblai.env--platformiblai.envbash
npx create-next-app@latest . --yes
iblai add auth
iblai add chat
pnpm dev从标准 Next.js 应用开始,按需添加功能:
CLI 会自动从 读取 变量。仅当你需要覆盖该配置或没有 文件时,才需要传递 参数。
iblai.envPLATFORMiblai.env--platformbash
npx create-next-app@latest . --yes
iblai add auth
iblai add chat
pnpm devFull ibl.ai Agent App
完整 ibl.ai Agent 应用
Scaffold a complete app with auth, chat, and everything pre-configured.
Always create in a temp directory and copy back to the current directory:
bash
iblai startapp agent -o .iblai-init
cp -a .iblai-init/<app-name>/. . && rm -rf .iblai-init
cp .env.example .env.local
pnpm install && pnpm dev搭建包含鉴权、聊天等所有预配置的完整应用。请始终先在临时目录创建,再复制回当前目录:
bash
iblai startapp agent -o .iblai-init
cp -a .iblai-init/<app-name>/. . && rm -rf .iblai-init
cp .env.example .env.local
pnpm install && pnpm devNon-Interactive (CI/CD)
非交互模式(CI/CD)
bash
iblai startapp agent --yes --platform acme --agent my-id --app-name my-app -o .iblai-init
cp -a .iblai-init/my-app/. . && rm -rf .iblai-init
cp .env.example .env.localbash
iblai startapp agent --yes --platform acme --agent my-id --app-name my-app -o .iblai-init
cp -a .iblai-init/my-app/. . && rm -rf .iblai-init
cp .env.example .env.localAI-Enhanced Scaffolding
AI 增强脚手架
Set your API key as an environment variable (never pass secrets as CLI arguments):
bash
export ANTHROPIC_API_KEY=<your-key>
iblai startapp agent \
--prompt "kids learning assistant with bright colors"将你的 API 密钥设置为环境变量(切勿将密钥作为 CLI 参数传递):
bash
export ANTHROPIC_API_KEY=<your-key>
iblai startapp agent \
--prompt "kids learning assistant with bright colors"Available Components
可用组件
| Command | What It Adds | Skill |
|---|---|---|
| MCP servers + skills (run first) | |
| SSO authentication | |
| AI chat widget (requires agent ID) | |
| User profile dropdown | |
| Account/organization settings | |
| Analytics dashboard | |
| Notification bell | |
| User invitation dialogs | | |
| Workflow builder components | | |
| Tauri v2 desktop/mobile shell |
| 命令 | 添加内容 | 对应 Skill |
|---|---|---|
| MCP 服务器 + skills(请优先运行) | |
| SSO 身份验证 | |
| AI 聊天组件(需要 agent ID) | |
| 用户资料下拉菜单 | |
| 账户/组织设置 | |
| 数据分析看板 | |
| 通知铃铛 | |
| 用户邀请对话框 | | |
| 工作流构建器组件 | | |
| Tauri v2 桌面/移动端外壳 |
Component Gallery
组件库展示
All components below are from (v1.1.28). Use MCP tools
(, ) for full props and usage examples.
@iblai/iblai-js/web-containersget_component_infoget_hook_infoAuto-generated fromtype declarations. Re-generate with:@iblai/web-containers@1.1.28iblai update-gallery <path>
以下所有组件均来自 (v1.1.28)。使用 MCP 工具(、)可查看完整属性和使用示例。
@iblai/iblai-js/web-containersget_component_infoget_hook_info由类型声明自动生成。可通过以下命令重新生成:@iblai/web-containers@1.1.28iblai update-gallery <path>
Authentication & SSO
身份验证与 SSO
| Export | Import | Description |
|---|---|---|
| sso | Default localStorage key constants for SSO |
| root | Auth login button -- redirects to |
| root | Signup button -- opens signup flow, optionally in new tab |
| next | SSO callback handler -- stores tokens from URL into localStorage and redirects |
typescript
import { DEFAULT_SSO_STORAGE_KEYS } from "@iblai/iblai-js/web-containers/sso";
import { LoginButton, SignupButton } from "@iblai/iblai-js/web-containers";
import { SsoLogin } from "@iblai/iblai-js/web-containers/next";| 导出项 | 导入路径 | 说明 |
|---|---|---|
| sso | SSO 使用的默认 localStorage 键常量 |
| root | 身份验证登录按钮——携带重定向参数跳转至 |
| root | 注册按钮——开启注册流程,可选择在新标签页打开 |
| next | SSO 回调处理器——将 URL 中的令牌存入 localStorage 并执行重定向 |
typescript
import { DEFAULT_SSO_STORAGE_KEYS } from "@iblai/iblai-js/web-containers/sso";
import { LoginButton, SignupButton } from "@iblai/iblai-js/web-containers";
import { SsoLogin } from "@iblai/iblai-js/web-containers/next";User Profile & Account
用户资料与账户
| Export | Import | Description |
|---|---|---|
| next | Account/org settings with tabs (Organization, Management, Integrations, Advanced, Billing) |
| root | Company selection dialog |
| root | Dialog for adding/editing education |
| root | Education background management |
| root | Dialog for adding/editing experience |
| root | Professional experience management |
| root | Institution selection dialog |
| root | Dialog to invite users to a tenant |
| root | Dialog showing pending invitations |
| root | Local LLM model management (Tauri desktop) |
| next | Organization settings tab |
| root | Full profile management component |
| root | Resume upload and display |
| next | Avatar dropdown with profile, organization, tenant switcher, logout |
| next | Profile editing modal with tabs (Basic, Social, Education, Experience, Resume, Security) |
typescript
import { Account, OrganizationTab, UserProfileDropdown, UserProfileModal } from "@iblai/iblai-js/web-containers/next";
import { CompanyDialog, EducationDialog, EducationTab, ExperienceDialog, ExperienceTab, InstitutionDialog, ... } from "@iblai/iblai-js/web-containers";| 导出项 | 导入路径 | 说明 |
|---|---|---|
| next | 账户/组织设置页,包含标签页(组织、管理、集成、高级设置、账单) |
| root | 公司选择对话框 |
| root | 新增/编辑教育背景对话框 |
| root | 教育背景管理页 |
| root | 新增/编辑工作经历对话框 |
| root | 工作经历管理页 |
| root | 机构选择对话框 |
| root | 邀请用户加入租户的对话框 |
| root | 展示待处理邀请的对话框 |
| root | 本地 LLM 模型管理页(Tauri 桌面端) |
| next | 组织设置标签页 |
| root | 完整的资料管理组件 |
| root | 简历上传与展示页 |
| next | 头像下拉菜单,包含资料、组织、租户切换、登出功能 |
| next | 资料编辑弹窗,包含标签页(基础信息、社交账号、教育背景、工作经历、简历、安全设置) |
typescript
import { Account, OrganizationTab, UserProfileDropdown, UserProfileModal } from "@iblai/iblai-js/web-containers/next";
import { CompanyDialog, EducationDialog, EducationTab, ExperienceDialog, ExperienceTab, InstitutionDialog, ... } from "@iblai/iblai-js/web-containers";Tenant & Organization
租户与组织
| Export | Import | Description |
|---|---|---|
| root | Switch between tenants/organizations with RBAC support |
typescript
import { TenantSwitcher } from "@iblai/iblai-js/web-containers";| 导出项 | 导入路径 | 说明 |
|---|---|---|
| root | 租户/组织切换器,支持 RBAC |
typescript
import { TenantSwitcher } from "@iblai/iblai-js/web-containers";Analytics
数据分析
| Export | Import | Description |
|---|---|---|
| root | Access time heatmap visualization |
| root | Single course detail view |
| root | Course analytics listing |
| root | Financial/billing statistics |
| root | Layout wrapper for analytics pages |
| root | Overview dashboard with key metrics |
| root | Single program detail view |
| root | Program analytics listing |
| root | Download analytics reports |
| root | Report listing and management |
| root | Context provider for analytics settings |
| root | Topic/conversation statistics |
| root | Transcript browsing and search |
| root | User activity statistics |
| root | Wrapper for chart visualizations |
| root | Context provider for chart filter state |
| root | Custom date range selector |
| root | Empty state placeholder for stats |
| root | Filter analytics by user groups |
| root | Single statistic card |
| root | Time range filter dropdown |
typescript
import { AccessTimeHeatmap, AnalyticsCourseDetail, AnalyticsCourses, AnalyticsFinancialStats, AnalyticsLayout, AnalyticsOverview, ... } from "@iblai/iblai-js/web-containers";| 导出项 | 导入路径 | 说明 |
|---|---|---|
| root | 访问时间热力图可视化 |
| root | 单门课程详情视图 |
| root | 课程数据分析列表 |
| root | 财务/账单统计 |
| root | 数据分析页面布局容器 |
| root | 概览看板,展示核心指标 |
| root | 单个项目详情视图 |
| root | 项目数据分析列表 |
| root | 数据分析报告下载功能 |
| root | 报告列表与管理页 |
| root | 数据分析设置的上下文提供者 |
| root | 主题/对话统计 |
| root | 转录内容浏览与搜索 |
| root | 用户活动统计 |
| root | 图表可视化容器 |
| root | 图表筛选状态的上下文提供者 |
| root | 自定义日期范围选择器 |
| root | 统计数据为空的占位状态 |
| root | 按用户组筛选数据分析结果的下拉菜单 |
| root | 单个统计指标卡片 |
| root | 时间范围筛选下拉菜单 |
typescript
import { AccessTimeHeatmap, AnalyticsCourseDetail, AnalyticsCourses, AnalyticsFinancialStats, AnalyticsLayout, AnalyticsOverview, ... } from "@iblai/iblai-js/web-containers";Notifications
通知
| Export | Import | Description |
|---|---|---|
| root | Alert management tab |
| root | Dialog to create/edit alerts |
| root | Full notification center with Inbox and Alerts tabs |
| root | Bell icon with unread badge -- compact navbar widget |
| root | Dialog to compose and send notifications (admin) |
typescript
import { AlertsTab, EditAlertDialog, NotificationDisplay, NotificationDropdown, SendNotificationDialog } from "@iblai/iblai-js/web-containers";| 导出项 | 导入路径 | 说明 |
|---|---|---|
| root | 告警管理标签页 |
| root | 创建/编辑告警的对话框 |
| root | 完整的通知中心,包含收件箱和告警标签页 |
| root | 带未读角标的铃铛图标——紧凑的导航栏组件 |
| root | 撰写和发送通知的对话框(管理员用) |
typescript
import { AlertsTab, EditAlertDialog, NotificationDisplay, NotificationDropdown, SendNotificationDialog } from "@iblai/iblai-js/web-containers";Mentor UI (App Shell)
Mentor UI(应用外壳)
| Export | Import | Description |
|---|---|---|
| next | Collapsible sidebar with menu items, projects, pinned/recent messages |
| next | Guided prompt cards for starting conversations |
| next | Top navigation bar with user menu, mentor dropdown, new chat action |
typescript
import { AppSidebar, ConversationStarters, NavBar } from "@iblai/iblai-js/web-containers/next";| 导出项 | 导入路径 | 说明 |
|---|---|---|
| next | 可折叠侧边栏,包含菜单项、项目、置顶/最近消息 |
| next | 引导式提示词卡片,用于快速开启对话 |
| next | 顶部导航栏,包含用户菜单、mentor 下拉菜单、新建聊天按钮 |
typescript
import { AppSidebar, ConversationStarters, NavBar } from "@iblai/iblai-js/web-containers/next";Workflows
工作流
| Export | Import | Description |
|---|---|---|
| root | Connector setup and management |
| root | Create new workflow modal |
| root | Delete workflow confirmation |
| root | Tool configuration dialogs |
| root | Workflow node type browser sidebar |
typescript
import { ConnectorManagementDialog, CreateWorkflowModal, DeleteWorkflowModal, ToolDialogs, WorkflowSidebar } from "@iblai/iblai-js/web-containers";| 导出项 | 导入路径 | 说明 |
|---|---|---|
| root | 连接器设置与管理对话框 |
| root | 创建新工作流的弹窗 |
| root | 删除工作流的确认弹窗 |
| root | 工具配置对话框集合 |
| root | 工作流节点类型浏览侧边栏 |
typescript
import { ConnectorManagementDialog, CreateWorkflowModal, DeleteWorkflowModal, ToolDialogs, WorkflowSidebar } from "@iblai/iblai-js/web-containers";Content & Display
内容与展示
| Export | Import | Description |
|---|---|---|
| root | Copy-to-clipboard button icon |
| root | Loading overlay component |
| root | Markdown renderer with syntax highlighting and copy buttons |
| root | Tiptap-based rich text editor (HTML or Markdown output) |
| root | Multi-select dropdown with search filtering |
| root | Loading spinner (sm, md, lg) |
| root | Provider for automatic time tracking |
| root | Dismissible top banner notification bar |
| root | App version display footer |
typescript
import { CopyButtonIcon, Loader, Markdown, RichTextEditor, SearchableMultiSelect, Spinner, ... } from "@iblai/iblai-js/web-containers";| 导出项 | 导入路径 | 说明 |
|---|---|---|
| root | 复制到剪贴板按钮图标 |
| root | 加载遮罩组件 |
| root | Markdown 渲染器,支持语法高亮和复制按钮 |
| root | 基于 Tiptap 的富文本编辑器(支持输出 HTML 或 Markdown) |
| root | 支持搜索筛选的多选下拉菜单 |
| root | 加载动画(支持 sm, md, lg 三种尺寸) |
| root | 自动时间追踪功能的提供者 |
| root | 可关闭的顶部通知栏 |
| root | 应用版本展示页脚 |
typescript
import { CopyButtonIcon, Loader, Markdown, RichTextEditor, SearchableMultiSelect, Spinner, ... } from "@iblai/iblai-js/web-containers";Error Handling
错误处理
| Export | Import | Description |
|---|---|---|
| next | Client-side error boundary page |
| next | Error page with code, message, support link, home button |
typescript
import { ClientErrorPage, ErrorPage } from "@iblai/iblai-js/web-containers/next";| 导出项 | 导入路径 | 说明 |
|---|---|---|
| next | 客户端错误边界页面 |
| next | 错误页面,包含错误码、错误信息、支持链接、返回首页按钮 |
typescript
import { ClientErrorPage, ErrorPage } from "@iblai/iblai-js/web-containers/next";Hooks & Utilities
Hooks 与工具函数
| Export | Import | Description |
|---|---|---|
| root | Tauri IPC command name constants |
| root | Tauri event name constants |
typescript
import { TAURI_COMMANDS, TAURI_EVENTS } from "@iblai/iblai-js/web-containers";| 导出项 | 导入路径 | 说明 |
|---|---|---|
| root | Tauri IPC 命令名常量 |
| root | Tauri 事件名常量 |
typescript
import { TAURI_COMMANDS, TAURI_EVENTS } from "@iblai/iblai-js/web-containers";UI Primitives (Shadcn/Radix)
UI 基础组件(Shadcn/Radix)
These are bundled with the SDK and share the ibl.ai Tailwind theme. Available
when you need lower-level building blocks inside SDK component customizations:
AlertDialogAvatarBadgeButtonCalendarCardCardContentCardDescriptionCardFooterCardHeaderCardTitleChartCheckboxDialogDropdownMenuInputLabelPaginationPopoverProgressRadioGroupSelectSeparatorSheetSidebarSkeletonSonnerSwitchTableTabsTextareaToastToasterToggleTooltipNote: For your own UI, install shadcn/ui directly () rather than importing these from the SDK. The SDK exports are for internal use and SDK component customization.npx shadcn@latest add ...
这些组件与 SDK 打包在一起,共享 ibl.ai 的 Tailwind 主题。当你在自定义 SDK 组件需要更低层级的构建块时可以使用:
AlertDialogAvatarBadgeButtonCalendarCardCardContentCardDescriptionCardFooterCardHeaderCardTitleChartCheckboxDialogDropdownMenuInputLabelPaginationPopoverProgressRadioGroupSelectSeparatorSheetSidebarSkeletonSonnerSwitchTableTabsTextareaToastToasterToggleTooltip注意: 如果你需要构建自己的 UI,请直接安装 shadcn/ui(),不要从 SDK 中导入这些组件。SDK 导出的这些组件仅用于内部使用和 SDK 组件自定义。npx shadcn@latest add ...
Component Priority
组件使用优先级
- ibl.ai components first -- always use the native component when one exists
- shadcn/ui for everything else -- forms, tables, modals, date pickers, etc.:
bash
npx shadcn@latest add button dialog table form - shadcnspace blocks -- pre-built page sections:
bash
npx shadcn@latest add @shadcn-space/hero-01
ibl.ai and shadcn components share the same Tailwind theme and are visually seamless.
- 优先使用 ibl.ai 组件——如果有原生组件存在时请始终使用原生组件
- 其他需求使用 shadcn/ui——表单、表格、弹窗、日期选择器等:
bash
npx shadcn@latest add button dialog table form - shadcnspace 区块——预构建的页面区块:
bash
npx shadcn@latest add @shadcn-space/hero-01
ibl.ai 和 shadcn 组件共享同一套 Tailwind 主题,视觉上完全统一。
CLI Updates
CLI 更新
Before running any command, ensure the CLI is
up to date. Run to check the current version, then
upgrade directly:
iblaiiblai --version- pip:
pip install --upgrade iblai-app-cli - npm:
npm install -g @iblai/cli@latest
This is safe to run even if already at the latest version.
在运行任何 命令前,请确保 CLI 是最新版本。运行 查看当前版本,然后直接升级:
iblaiiblai --version- pip:
pip install --upgrade iblai-app-cli - npm:
npm install -g @iblai/cli@latest
即使已经是最新版本,运行该命令也是安全的。
Requirements
要求
- Next.js App Router project (app/ directory)
- Node.js 18+
- CLI available (
iblai). Seeiblai --versionprerequisites for installation./iblai-auth - Run first to set up MCP servers and skills
iblai add mcp - If you started with , run
npx create-next-app@latestfirst -- other components depend on the auth providersiblai add auth - If you used , auth is already set up
iblai startapp agent - Brand guidelines: BRAND.md
- Next.js App Router 项目(app/ 目录结构)
- Node.js 18+
- 可用的 CLI(执行
iblai验证)。查看iblai --version前置条件了解安装方式/iblai-auth - 请先运行 设置 MCP 服务器和 skills
iblai add mcp - 如果你是从 初始化的项目,请先运行
npx create-next-app@latest——其他组件依赖鉴权提供者iblai add auth - 如果你使用 创建项目,鉴权已经预配置完成
iblai startapp agent - 品牌规范: BRAND.md