Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计通过

renderless-components无渲染组件

Agent Skill

renderless-components 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,879

周安装

76

GitHub Stars

173

下载量

590
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:renderless-components(无渲染组件)
来源仓库:https://github.com/patternsdev/skills
仓库路径:skills/renderless-components
安装命令:
npx skills add https://github.com/patternsdev/skills --skill renderless-components
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/patternsdev/skills --skill renderless-components

简介

renderless-components 用于处理 GitHub 仓库、Issue、Pull Request 等协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中围绕代码变更进行整理。

  • 它可辅助分析仓库状态、代码差异或协作事项,适用于开发流程管理。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,需结合原始 README 核验用法。
  • 安装前建议确认权限范围、维护状态及是否触发联网或文件操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Renderless Components

Table of Contents

Renderless components are a pattern in Vue that separates the logic of a component from its presentation. The pattern provides a way to encapsulate functionality without *dictating the visual representation of the component*. In other words, a renderless component focuses solely on the logic and behavior, while leaving the rendering to the parent component.

Renderless components are particularly useful when we need to create reusable logic that can be applied to different UI implementations. By abstracting the logic into a renderless component, we can easily reuse it in various contexts without duplicating code.

When to Use

  • Use this when you need to reuse logic across components with completely different visual representations
  • This is helpful for providing a component-based API in a component library

When NOT to Use

  • When composables achieve the same logic reuse without extra component nesting (Vue 3+)
  • When the renderless component wraps trivial logic that a simple function or composable handles more clearly
  • When the scoped slot API becomes harder to understand than a direct composable return value

Instructions

  • Create a component that provides data and methods through a single <slot> with scoped slot props
  • Use v-slot destructuring in parent components to access the provided data and methods
  • Prefer composables over renderless components in Vue 3 to avoid extra component nesting
  • Use renderless components when you want template-level composition or a component-based API

Details

Toggle, toggle, toggle

Imagine you have a toggle UI element that needs to be used in different parts of your application, but each instance may have a different visual representation. Some toggles might be displayed as buttons, while others might be checkboxes or switches.

We could just create three different toggle components, however, we can observe that each toggle element has the same logic and behavior. Each toggle has an inactive and active state that's being tracked with a component data property (e.g. checked). When a toggle is clicked, its component state is switched from inactive to active and vice versa (i.e. checked =!checked).

Right away, we can see that we can create a more reusable pattern by extracting the common logic and behavior in such a way that we don't have to repeatedly define the state and toggle methods in each individual toggle component. This is a great case to use composables since composables will allow us to encapsulate and share the common stateful logic across the different toggle components.

useCheckboxToggle:

import { ref } from "vue";

export function useCheckboxToggle() {
  const checkbox = ref(false);

  const toggleCheckbox = () => {
    checkbox.value = !checkbox.value;
  };

  return {
    checkbox,
    toggleCheckbox,
  };
}

With this composable, we can now use the useCheckboxToggle() function in our various toggle components to share the common state and toggle logic.

However, there's another approach we can take that leverages Vue's slot mechanism — the renderless component pattern.

The Renderless Component

A renderless component in Vue is a component that encapsulates logic and provides data to its children via scoped slots, without rendering any markup of its own. The parent component decides how the data is presented.

Here's a simple renderless Toggle component:

<script setup>
  import { ref } from "vue";

  const checked = ref(false);

  const toggle = () => {
    checked.value = !checked.value;
  };
</script>

<template>
  <slot :checked="checked" :toggle="toggle"></slot>
</template>

The Toggle component doesn't render any HTML of its own. It only provides data (checked and toggle) through a scoped slot. The parent component can now consume this data and render whatever UI it wants.

Using the renderless Toggle as a button:

<template>
  <Toggle v-slot="{ checked, toggle }">
    <button @click="toggle">
      {{ checked ? "ON" : "OFF" }}
    </button>
  </Toggle>
</template>

Using the renderless Toggle as a checkbox:

<template>
  <Toggle v-slot="{ checked, toggle }">
    <label>
      <input type="checkbox" :checked="checked" @change="toggle" />
      {{ checked ? "Checked" : "Unchecked" }}
    </label>
  </Toggle>
</template>

Using the renderless Toggle as a switch:

<template>
  <Toggle v-slot="{ checked, toggle }">
    <div
      class="switch"
      :class="{ active: checked }"
      @click="toggle"
    >
      <div class="switch-handle"></div>
    </div>
  </Toggle>
</template>

In all three cases, the same Toggle renderless component provides the toggle logic, but the rendering is entirely different!

Composables vs. Renderless Components

Both composables and renderless components achieve the goal of reusing logic across components. However, there are some differences:

Composables:

  • Logic is encapsulated in a regular JavaScript function.
  • Can be used directly in <script setup> or setup().
  • Don't involve any additional component layers.

Renderless components:

  • Logic is encapsulated in a Vue component.
  • Use scoped slots to pass data to children.
  • Add an extra component layer in the template.

In general, composables are the preferred approach in Vue 3 since they don't add extra component nesting. However, renderless components can be useful when you want to provide a component-based API (e.g., in a component library) or when you need template-level composition.

Source

References

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.04%
按下载量换算219

Claude

29.03%
按下载量换算171

Cursor

19.04%
按下载量换算112

Gemini CLI

8.98%
按下载量换算53

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills