Agent Skills › telepath-computer/television › tv-sidebar-view

tv-sidebar-view

GitHub

用于创建包含导航侧边栏和详情面板的 HTML 组件,实现多视图切换与主从结构展示。

packages/skills/skills/tv-sidebar-view/SKILL.md telepath-computer/television

Trigger Scenarios

需要构建具有列表导航功能的界面 创建支持视图切换的主从布局页面

Install

npx skills add telepath-computer/television --skill tv-sidebar-view -g -y
More Options

Non-standard path

npx skills add https://github.com/telepath-computer/television/tree/main/packages/skills/skills/tv-sidebar-view -g -y

Use without installing

npx skills use telepath-computer/television@tv-sidebar-view

指定 Agent (Claude Code)

npx skills add telepath-computer/television --skill tv-sidebar-view -a claude-code -g -y

安装 repo 全部 skill

npx skills add telepath-computer/television --all -g -y

预览 repo 内 skill

npx skills add telepath-computer/television --list

SKILL.md

Frontmatter
{
    "name": "tv-sidebar-view",
    "description": "Create master–detail HTML artifacts for Television — a navigation sidebar of items that switches between views authored in the same artifact."
}

Authoring a sidebar view

Know the main television skill first (re-read only if it's not in context or changed) — it covers the Television workflow, artifact registration, and the canonical HTML house style. This skill adds the master–detail vocabulary: a sidebar of items, in groups, beside a detail pane of views. Pressing an item shows its view.

Use it when one artifact holds several views the user will switch between — a review surface over a dataset, a project browser, anything list-navigates-content.

Load these

Every artifact is self-contained. Carry sidebar.css and sidebar.js from this skill folder into the output (don't reference /skills/tv-sidebar-view/… URLs).

For a directory artifact, copy both next to index.html and load them with the canonical boilerplate:

<link rel="stylesheet" href="/canonical/v2/styles.css?authoredForAppVersion=<version>" />
<script type="module" src="/canonical/v2/components.js"></script>
<link rel="stylesheet" href="./sidebar.css" />
<script type="module" src="./sidebar.js"></script>

For a running server, read the exact release version from tv status; when working in a Television checkout, read the exact version from the checkout root package.json. Copy that exact release version unchanged into authoredForAppVersion. A missing version or the 0.0.0 development sentinel does not identify a release, so omit the metadata.

For a single-file artifact, inline them into <style> and <script type="module"> tags instead. sidebar.js makes the sidebar work — selection, view switching, and the draggable sidebar width, which everyone viewing the artifact shares. It keeps the width at tv-sidebar-view/width in the artifact's own JSON store, so keep any other data the artifact stores there under other paths.

Leave the body at zero padding: the sidebar and views supply their own gutters.

Markup

Author this shape — the sidebar and its views, keyed to each other by the item identity:

<div class="sidebar-view">
  <tv-sidebar>
    <tv-sidebar-group>
      <tv-sidebar-item item="all-tasks" selected><label>All tasks</label></tv-sidebar-item>
    </tv-sidebar-group>
    <tv-sidebar-group>
      <h2>Projects</h2>
      <tv-sidebar-item item="riso-zine"><label>Launch riso zine issue 3</label></tv-sidebar-item>
      <tv-sidebar-item item="studio-move"><label>Move studio to carriage works</label></tv-sidebar-item>
    </tv-sidebar-group>
  </tv-sidebar>
  <main class="detail">
    <tv-view item="all-tasks" shown>
      <!-- free-form content for this view -->
    </tv-view>
    <tv-view item="riso-zine">…</tv-view>
    <tv-view item="studio-move">…</tv-view>
  </main>
</div>

Rules

  • Items always live in groups. For ungrouped items, use a group with no h2 — that is the idiom; never place an item directly in tv-sidebar.
  • Labels go in a <label>. No icons in items or group titles for now.
  • Every item names a view. The item attribute is the identity; each tv-view carries the same identity, and the one matching the selection is shown. One view per item, views only inside .detail.
  • Author the initial state: exactly one item selected, and shown on its view.
  • Never attach your own click handlers to sidebar parts — sidebar.js owns selection, view switching, and the resizable sidebar edge. Wire nothing.
  • View content is free-form. Anything can go inside a tv-view — markup, task lists, even an <iframe>. Style your content; the skill styles the sidebar and the frame.

Version History

  • a8e73fb Current 2026-10-18 15:28

Same Skill Collection

developer-skills/cold-reader/SKILL.md
developer-skills/deploy-tv-admin-guide/SKILL.md
developer-skills/deploy-tv-update-channel/SKILL.md
developer-skills/logical-merging/SKILL.md
developer-skills/plain-english-full/SKILL.md
developer-skills/plain-english/SKILL.md
developer-skills/pr-writing/SKILL.md
developer-skills/tvdev-contribute/SKILL.md
developer-skills/tvdev-review/SKILL.md
developer-skills/tvdev-setup/SKILL.md
packages/skills/skills/tv-calendar/SKILL.md
packages/skills/skills/tv-table/SKILL.md
packages/skills/skills/tv-tasks/SKILL.md
developer-skills/complexity-inoculation/SKILL.md

Metadata

Files
0
Version
a8e73fb
Hash
06ab1006
Indexed
2026-10-18 15:28

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-19 11:10
浙ICP备14020137号-1