SkillAtlasSkill 详情

preline-mcp

Preline UI is an open-source Tailwind CSS UI component library for building modern websites and...

审核状态:已审核Quality 72Security 52

复制安装命令

用 Codex 或 Claude 安装复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它先审查 Skill 页面再帮你安装。

复制前请先查看来源、License 和安全提示。

项目 README

来源文件:README.md

抓取于 2026年8月21日

Hero Image

Preline UI logo

Preline UI is an open-source Tailwind CSS UI component library for building modern websites and apps. It includes UI blocks, templates, plugins, a Figma design system, and more.

License: MIT

✨ About Preline

Preline helps teams build modern websites and web apps faster with reusable Tailwind CSS components, interactive headless Tailwind CSS plugins, Tailwind CSS templates, and production-ready Tailwind CSS examples. It is designed for developers who want flexible markup, scalable design systems, and polished UI patterns without rebuilding everything from scratch.

⚡ Getting Started

Start with any working Tailwind CSS project and make sure Node.js and npm are installed.

Install via npm

  1. Install preline:
npm i preline
  1. Import the Preline CSS variants file into your Tailwind CSS file after the tailwindcss import:
@import "tailwindcss";

/* Preline UI */
@source "./node_modules/preline/dist/*.js";
@import "./node_modules/preline/variants.css";

/* Preline Themes */
@import "./themes/theme.css";
  1. Add the Preline JavaScript file near the end of your <body> tag:
<script src="./node_modules/preline/dist/preline.js"></script>

For setup details, framework integration, and configuration guides, visit the Preline documentation.

🤖 Agent Skills

Preline UI includes Agent Skills for agentic coding tools such as Cursor, Claude Code, and Gemini CLI, making it easier to automate theme generation and UI workflows.

Install via CLI:

npx skills add htmlstreamofficial/preline

♿ Accessibility

Preline UI includes enterprise-grade accessibility built into its components, helping teams create more inclusive interfaces with accessible Tailwind CSS components, keyboard-friendly interactions, proper focus management, and stronger support for assistive technologies. Learn more in the dedicated Accessibility documentation.

🧩 Headless Tailwind CSS Plugins

Explore headless Tailwind CSS plugins for accessible UI behavior, interactions, forms, navigation, overlays, and productivity workflows.

CategoryPlugin Pages
DisclosureAccordion, Collapse, Tree View
NavigationsTabs, Scrollspy, Scroll Nav, Stepper
OverlaysDropdown, Overlay, Tooltip
FormsSelect, ComboBox, Datepicker, Range Slider, Input Number, File Upload, Strong Password, Toggle Password, Toggle Count, Copy Markup, PIN Input, Textarea Auto Height
MiscellaneousDataTable, Carousel, Layout Splitter, Remove Element, Theme Switch

🧱 Tailwind CSS Components

Browse Tailwind CSS component docs across layout, base UI, forms, navigation, overlays, tables, and advanced integrations.

CategoryComponent Pages
Layout & ContentContainer, Columns, Grid, Layout Splitter, Typography, Images, Links, Dividers & HR, KBD, Custom Scrollbar
Base ComponentsAccordion, Alerts, Avatar, Avatar Group, Badge, Blockquote, Buttons, Button Group, Card, Chat Bubbles, Carousel, Collapse, Datepicker, Devices, Lists, List Group, Legend Indicator, Progress, File Uploading Progress, Ratings, Skeleton, Spinners, Styled Icons, Toasts, Timeline, Tree View
NavigationsNavbar, Mega Menu, Navs, Tabs, Sidebar, Scrollspy, Breadcrumb, Pagination, Stepper
Basic FormsInput, Input Group, Textarea, File Input, Checkbox, Radio, Switch, Select, Range Slider, Color Picker, Time Picker
Advanced FormsAdvanced Select, ComboBox, SearchBox, Input Number, Strong Password, Toggle Password, Toggle Count, Copy Markup, PIN Input
OverlaysDropdown, Context Menu, Modal, Offcanvas, Popover, Tooltip
TablesTables
Third-Party PluginsAdvanced Range Slider, Advanced Datepicker, Charts, Clipboard, Confetti Animation, Datamaps, Datatables, Drag and Drop, File Upload, Maps, Toast Notifications, WYSIWYG Editor

🎨 Templates and Examples

Explore free and premium layouts for landing pages, dashboards, SaaS apps, ecommerce stores, CMS products, portfolios, and more.

Free Tailwind CSS Templates

TemplateTemplateTemplateTemplateTemplate
AgencyAI ChatCMSCoffee ShopPersonal

Explore More

🚀 Preline Pro

Preline Pro extends the free library with premium UI for serious product teams and commercial apps. It includes 740 premium Tailwind CSS blocks and sections, 21 premium Tailwind CSS templates, and 207 pages for admin dashboards, SaaS products, ecommerce, CMS, CRM, analytics, finance, chat, startup, and marketing use cases.

📚 Documentation and Resources

🤝 Community

For help, best practices, and product discussions, use GitHub Discussions.

Follow Preline UI on X (Twitter) for the latest updates.

📄 License

Preline UI is free for personal and commercial projects under the MIT License and the Preline UI Fair Use License. Copyright 2026 by Preline Labs Ltd.

The Preline UI Figma resources are also available for personal and commercial use. All brand icons are trademarks of their respective owners, and their use does not imply endorsement.

A Product of Htmlstream

Preline UI is built by the Htmlstream team, crafting UI components and templates since 2013—helping teams ship faster with scalable, flexible design systems for real-world products.

Share your thoughts about Preline UI on X (Twitter).

Agent / MCP / Skill 创作

高风险

  • 来源需自行核对维护者身份。
  • 包含脚本或命令调用,安装前请复核。
  • 可能需要外部 token、网络权限或第三方服务。
  • 存在潜在风险命令,请谨慎安装。
  • 扫描发现:1 条。

Codex — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/htmlstreamofficial/preline.git
  3. 将 "skills/preline-mcp" 文件夹复制到 Codex 的 skills 目录中。
  4. 重启 Codex 让新的 skill 生效。

Codex — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Codex 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Codex 让新的 skill 生效。

Claude Code — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/htmlstreamofficial/preline.git
  3. 将 "skills/preline-mcp" 文件夹复制到 Claude Code 的 skills 目录中。
  4. 重启 Claude Code 让新的 skill 生效。

Claude Code — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Claude Code 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Claude Code 让新的 skill 生效。

Cursor — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/htmlstreamofficial/preline.git
  3. 将 "skills/preline-mcp" 文件夹复制到 Cursor 的 skills 目录中。
  4. 重启 Cursor 让新的 skill 生效。

Cursor — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Cursor 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Cursor 让新的 skill 生效。

GitHub Copilot — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/htmlstreamofficial/preline.git
  3. 将 "skills/preline-mcp" 文件夹复制到 GitHub Copilot 的 skills 目录中。
  4. 重启 GitHub Copilot 让新的 skill 生效。

GitHub Copilot — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 GitHub Copilot 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 GitHub Copilot 让新的 skill 生效。

Windsurf — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/htmlstreamofficial/preline.git
  3. 将 "skills/preline-mcp" 文件夹复制到 Windsurf 的 skills 目录中。
  4. 重启 Windsurf 让新的 skill 生效。

Windsurf — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Windsurf 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Windsurf 让新的 skill 生效。
查看 SKILL.md 原文
name: preline-mcp
description: Add, integrate, or build Preline UI components and blocks into HTML files via the Preline MCP server. Use when the user mentions "preline", says "/preline", asks to add a UI component, or requests a Preline block (a ready-made page section) using Preline UI.

Preline MCP

Intent

Use this skill to integrate Preline UI components and blocks into HTML files via the Preline MCP server. The server exposes 6 tools that return integration-ready HTML, CSS, and JS.

Activate when:

  • User says "preline", "add preline", "/preline", "use preline"
  • User asks for a Tailwind CSS component from the Preline library
  • User asks for a block (ready-made page section) or a starter page

Defaults

  • Never guess slugs. All section, component, and category identifiers are exact kebab-case strings. Always discover them via components_list or blocks_categories first.
  • One at a time. Retrieve one component or block, integrate it fully, then move to the next.
  • Always read the target file before inserting anything.
  • Call components_list({ section: "<inferred-slug>" }) when the component type is known - this keeps the response small. Omit section only when unsure.

Decision: Component vs Block

User saysUse
"component" / "components"Component workflow
"block" / "blocks" (or "example" / "examples")Block workflow
AmbiguousUse judgment; blocks give more complete results

Clarifying Vague Requests

Ask the user to pick instead of guessing in either of these cases:

  • Abstract request. Too abstract to confidently map onto one category/section, let alone one block/component - e.g. "give me something for a pricing page", "I need a nice form", "show me a dashboard example". Start at step 1 below.
  • Tied candidates. The request is concrete enough to reach a single category/section, but blocks_in_category / components_list({ section }) still leaves 2+ candidates whose titles + descriptions satisfy every criterion the request named about equally well (same layout/feature/style class), with nothing in the request to break the tie. Skip straight to step 3 below with just the tied candidates.

If exactly one candidate matches everything the request names ("a basic accordion", "the SaaS hero with tabs"), skip straight to the normal workflow - don't interrogate the user for things you can already resolve, and don't ask just to be safe when one option is clearly the best fit.

All clarifying questions and lists are in English by default - switch to the user's language only once they write to you in it.

Blocks:

  1. Ask which category fits. Call blocks_categories() and present the relevant mainSection / subSection / category paths with their titles and descriptions - the catalog carries a one-line description for every category, so present it directly rather than inventing your own summary.
  2. Try to resolve in one round. If the user's reply both names a category and describes the item distinctively enough to identify a single match (a specific layout, feature, or style), call blocks_in_category to confirm the exact ID and go straight to single_block - skip step 3 entirely.
  3. Otherwise, ask which block fits best. Call blocks_in_category({ mainSection, subSection, category }), list the block titles + descriptions - or just the tied candidates, for the case above - and ask the user to pick the one closest to their needs.
  4. Fetch and integrate the chosen block with single_block.

Components - same shape, sections instead of categories:

  1. Ask which section fits (components_list() for the full list, or components_list({ section }) once you can infer one).
  2. If the reply names a section and describes the component distinctively enough → resolve directly via single_component (lean on relative metadata - see Smart Component Selection - to land on the right default/variant).
  3. Otherwise list the components in that section (titles + descriptions, with relative.category groupings where present - or just the tied candidates, for the case above) and ask which fits best.
  4. Fetch and integrate with single_component.

Keep each round to one focused question with a short, scannable list - that beats an open "what do you want?" and beats guessing a slug just to avoid asking.

Composite & Layout Requests

When a request describes more than a single component - several pieces, a region, a full page, or an app shell - don't fetch ad-hoc. Plan the whole result first, then fetch and integrate one node at a time. The same steps apply to any shape: a dashboard, a settings page, a product page, a multi-step form, "a card/section/layout with X, Y and Z", etc.

  1. Lock cross-cutting constraints first. Anything that applies to the whole result - class system (theme tokens vs utilities → isUtilityBased / theme), shared surfaces/colors, spacing/density, repeated element states - decide once, up front. Keep it identical across every later fetch and edit.
  2. Decompose into a tree: containers → regions → leaf components. Write it down; each leaf is one fetch.
  3. Discover every node - route, then confirm. Use references/catalog-map.md to route: an abstract intent (a whole page/region/shell) → the right blocks_categories branch (reuse a ready-made block as the skeleton when one fits); each named element → the right components_list({ section }). The map only tells you where to look - always confirm the exact slug against the tool output before inserting.
  4. Assemble outermost-first, one at a time. The skeleton/outer container sets the shared surfaces and the script/init anchors; then fill inward region by region, integrating each fully (Integration Rules) before the next. Keep the returned classes, change text only - except the specific surfaces/colors/states the user asked to change. Apply every structural adaptation to the markup before writing it (see Adapt before you write in Integration Rules).
  5. Verify the finished result against the request, element by element.

See references/composite-layouts.md for the expanded method and worked illustrations.

Workflow: Components

1. components_list({ section: "<slug>" })   → get valid component IDs
2. single_component({ section, component }) → get HTML/CSS/JS
3. Read target file
4. Integrate HTML, CSS, scripts, init (see Integration Rules)
5. Repeat from step 1 only after integration is complete

Workflow: Blocks

1. blocks_categories()                                    → get hierarchy
2. blocks_in_category({ mainSection, subSection, category }) → get block IDs
3. single_block({ mainSection, subSection, category, block }) → get HTML/CSS/JS
4. Read target file
5. Integrate HTML, CSS, scripts, init (see Integration Rules)
6. Repeat from step 1 only after integration is complete

Integration Rules

HTML - insert where the user needs it.

CSS (<!-- CSS --> section):

  • MUST go inside <head>, immediately before </head>
  • NEVER place in <body> or near </body>

External scripts (<!-- Scripts --> section):

  • The <!-- Scripts --> label is a response section marker - NOT a location in the target file
  • Placement algorithm: open target file, scan upward from </body>, skipping blank lines, comments, and non-structural tags (</script>, </style>, etc.)
  • The first structural closing tag you reach (</main>, </section>, </div>, </footer>, </article>) is the anchor
  • Insert <script src> tags after that anchor, ordered around the existing Preline core script - the loaded <script src> whose src contains preline (e.g. …/preline/dist/index.js; exact path varies by install):
    • scripts whose src does not contain preline (third-party libs: lodash, apexcharts, …) → before the Preline core script
    • scripts whose src does contain preline (Preline helpers, e.g. hs-*-helpers.js) → after the Preline core script
    • if no Preline core script exists yet, keep order: scripts without preline, then scripts with preline
    • inline init <script> always comes last, immediately before </body>

Init (<!-- Init --> section):

  • Place immediately before </body>
  • Wrap in window.addEventListener('load', () => { ... }) unless the block already contains <script> tags

Large responses (artifacts): when a response is written to a temp scratch file, read it once with the Read tool (use offset/limit for big files), copy the needed blocks into the target, then delete the scratch file. Don't pull the whole artifact into context if you only need to place it.

Adapt before you write. When the request differs from the fetched markup - regions the user didn't ask for (breadcrumbs, demo menus, placeholder logos), different blocks or labels - produce the final markup in memory first, then write it into the target in ONE edit per region. Never insert fetched markup wholesale and refactor it with a chain of follow-up edits: every such edit re-transfers large markup, bloats context, and desyncs file state.

Same token = same color. Theme tokens (bg-navbar, bg-sidebar, bg-layer, …) are consistent across a theme - to give two surfaces the same color, give them the same token class. Never resolve tokens to raw colors by reading the project's CSS.

Trust the returned markup - do not re-verify it. The classes, structure, and data-hs-* attributes the MCP returns are valid Preline by construction. This is the single biggest time-sink to avoid. Do NOT:

  • grep, parse, or scan the user's compiled CSS (e.g. main.css) to "confirm" a class exists or to resolve what color a design token produces - Preline classes resolve at the consumer's build step, so absence from any one stylesheet means nothing;
  • write HTML/DOM/AST validators (Python HTMLParser, tag-balance checkers, etc.) - SVG and void elements trip naive parsers and produce false errors;
  • re-read a placed artifact or re-open the edited file just to "double-check" the generated code.

Place the markup, change text only, move on. Verify against the request (is every element the user named present?), never by auditing the generated code or the project's CSS.

Smart Component Selection

components_list may return a relative object per component:

  • isSectionDefault: true - recommended default for the section; prefer when the request is vague
    • Exception: if the description says "multiple variants" and the user wants one, pick a single-variant component instead
  • category - logical group (e.g. "color-variants", "states")
  • isCategoryDefault: true - recommended default for its category; prefer when the request implies a style group

Available Themes

default (blue) · harvest (amber) · retro (fuchsia) · moon (grayscale) · ocean (cyan) · bubblegum (pink) · cashmere (mauve) · autumn (orange) · olive (green)

Pass via isUtilityBased: true, theme: "<name>" on single_component or single_block.

Key References

发现问题?提交给管理员复核

评分:

评论 (0)

暂无评论,成为第一个评论者吧!