contact-widget
它能做什么
生成一个小型悬浮按钮,点击后会弹出聊天窗口。窗口中可以显示欢迎语、社交媒体链接、预约会面按钮和消息输入框。
适用场景
- ✓当你想在网站上添加便捷的联系方式时。
- ✓当你想为网站访客提供快速帮助时。
- ✓当你希望客户更容易预约会面时。
技能链接
https://github.com/nexu-io/open-design/blob/main/design-templates/contact-widget/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“帮我为网站做一个聊天挂件,带有预约会面按钮,并附上 WhatsApp 和 Instagram 的链接。”
每周 5 个新技能,1 分钟读完。
工作原理
它会生成一个 HTML 代码文件,你可以把它添加到网站中。这段代码会生成聊天窗口的外观和按钮,不需要借助其他工具。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Contact Widget
What this skill produces
A single self-contained HTML file with a floating chat widget that includes:
- Chat bubble — fixed bottom-right circular button, opens/closes the panel
- Welcome home screen — agent avatar + name + online status + greeting message
- Message input — text field with emoji/send icons (UI only; wire to your own backend)
- Social links — row of circular icons (Telegram, WhatsApp, Instagram, Messenger, Discord, Slack — only the ones the user provides)
- Meeting card — optional "Book a meeting" entry with calendar icon, links to user-provided URL (Calendly, Cal.com, Lark, etc.)
- Offline form — fallback contact form (name, email, message) when
is_available=false - Mobile responsive — full-width on small viewports
Output is pure front-end. No tracking, no phone-home, no required external services. Works offline once loaded.
Design direction
Clean, minimal SaaS aesthetic. Looks like a real product widget, not a toy demo:
- Typography: Inter (Google Fonts), 14px base, semi-bold headings
- Colors: A single user-chosen
primary_colordrives the bubble, avatar, send button, and accent. Everything else is a neutral slate palette (#1e293b/#64748b/#f1f5f9). No purple gradients, no glassmorphism, no AI-style rainbow accents. - Radius: 16px on cards, full-round on bubble and avatars
- Shadows: Subtle
0 8px 32px rgba(0,0,0,0.12)on the widget panel,0 4px 12pxon bubble - Spacing: 16px internal padding, 12px gaps between elements
- States: Hover darkens buttons ~5%, active scales bubble 0.95
Inputs
The skill accepts these parameters from the user:
| Input | Type | Default | Description |
|---|---|---|---|
primary_color |
color | #4F7CFF |
Drives bubble, header, send button, accents |
agent_name |
string | Assistant |
Displayed in header greeting |
greeting |
string | Hello! How can I help you today? |
Subtitle in header |
is_available |
boolean | true |
Online status; false shows offline form |
social_telegram |
string | (empty) | Telegram link — omitted if empty |
social_whatsapp |
string | (empty) | WhatsApp link — omitted if empty |
social_instagram |
string | (empty) | Instagram link — omitted if empty |
meeting_url |
string | (empty) | Booking URL (Calendly, Cal.com, etc.) — omitted if empty |
offline_message |
string | We're currently offline. Leave a message and we'll get back to you! |
Shown when is_available=false |
Workflow
- Resolve primary color, agent name, greeting text, online/offline state, social links, and optional meeting URL from the request and known context. Use the documented defaults and omit empty optional links. Ask one consolidated form only if a missing value would materially change the requested widget and cannot be safely defaulted.
- Generate one HTML file with all provided values inlined as literals (no template engine, no
{{ }}placeholders in the output) - Open the widget panel by default on first paint so the preview is useful
- Do not add any
<script src="…">pointing to third-party SDKs unless the user explicitly asks for backend integration. The output must run from disk with zero network calls beyond the Google Fonts CSS.
Backend integration (optional, user-driven only)
The generated widget is a UI artifact and ships zero vendor code by default. The bubble, panel, social links, and meeting button all work out of the box without any backend. Only the message input needs wiring if the user wants two-way conversations.
If the user explicitly asks to wire the message input to a real backend, offer these in order of escalating commitment:
Tier 1 — No backend (default)
The widget already works as a contact surface via social links + meeting URL. Leave it as-is.
Tier 2 — One-shot messages, no chat history
mailto:fallback — replace thesendhandler withwindow.location.href = 'mailto:you@example.com?subject=...&body=' + encodeURIComponent(text). Zero infra, but the visitor's mail client opens.- Own
/api/contactendpoint —fetch('/api/contact', { method: 'POST', body: JSON.stringify({ text }) }). The user owns delivery (SendGrid, Resend, their own SMTP, a Notion/Airtable webhook, etc.).
Tier 3 — Real-time chat (visitor ↔ agent, history, typing, presence)
…
常见问题
如果我不在线会怎样?
如果你把状态设为离线,挂件会显示一个表单,供访客留言并留下邮箱。
使用这个工具需要会编程吗?
不需要。输出的是可以直接使用的代码文件,你只需复制粘贴到网站中即可。
可以修改颜色和文字吗?
可以。你可以设置主色调、智能体的名字和欢迎语。
详情
作者的原始描述
Self-contained floating chat widget with welcome screen, social links, meeting button, and message input. Single HTML file, zero dependencies.
repo: nexu-io/open-design
热度
- GitHub 星标
- 101k
- 排名
- #867
- 许可证
- Apache-2.0
- 更新时间
- 2026/10/15
评论
- …