ต้นแบบ · รุ่นทดลอง: มีทุก server ในทะเบียนทางการ อัปเดตทุก 30 นาที เข้าสู่ระบบด้วย Google เพื่อเขียนรีวิวได้แล้วต้นแบบ · อัปเดตทุก 30 นาที
PopNx MCPที่รวม MCP สำหรับคนใช้ AI · วิธีติดตั้งภาษาไทยทุกตัว

planby Skill

โดย karolkozer★ 1,7241 skill

ติดตั้ง

ใช้ทำอะไรได้

ยังไม่มีคำอธิบายภาษาไทย ดูข้อเท็จจริงด้านล่าง หรือเปิดคำอธิบายต้นฉบับจากผู้ทำ

  • ต่อแบบ ไฟล์คำสั่งให้ AI อ่าน ไม่ต่อบริการใด
  • บัญชีหรือคีย์ ไม่ต้องใส่คีย์
  • หมวด เขียนโค้ด
คำอธิบายต้นฉบับจากผู้ทำ (อังกฤษ)
Planby is a component for a quick implementation of Schedules, Timelines, Electronic Program Guide, Calendar Planner, Music Events and many more ideas. It uses a custom virtual view which allows you to operate on a really big amount of data.
สำหรับผู้ทำ: ติดป้ายใน README

ถ้าคุณเป็นผู้ทำตัวนี้ คัดลอกโค้ดนี้ไปวางใน README ได้เลย ป้ายลิงก์กลับมาที่หน้านี้

[![แนะนำบน PopNx MCP](https://mcp.popnx.com/badge/skill/karolkozer-planby.svg?lang=th)](https://mcp.popnx.com/th/skills/karolkozer-planby)

ใช้คู่กับ

MCP ที่ต่อ AI เข้ากับบริการในงานเดียวกัน

REA

แกะการทำงานของโปรแกรมและแอปจากเทอร์มินัลหรือจาก AI

โดย morlutoใช้กันมาก↓ 388.7K/สัปดาห์★ 461.8Kอัปเดต 4 วันที่ผ่านมา

MCP · ต่อบริการรันบนเครื่อง

Fallow

Codebase intelligence for TypeScript and JavaScript, exposed as structured MCP analysis tools.

โดย fallow-rsใช้กันมาก↓ 2.4M/สัปดาห์★ 5.4Kอัปเดต เมื่อวาน

MCP · ต่อบริการรันบนเครื่อง

Desktop Commander

MCP server for terminal commands, file operations, and process management

โดย wonderwhy-erใช้กันมาก↓ 740.3K/สัปดาห์★ 10.3Kอัปเดต 4 วันที่ผ่านมา

MCP · ต่อบริการรันบนเครื่อง

Skill ที่ทำงานคล้ายกัน

หมวดงานเดียวกัน เรียงแบบเดียวกับหน้ารายการ Skill

เทียบกับตัวที่คล้ายกัน
ตัวนี้
planby
reagraphifyarchifysecurity-audit-skill
ผู้ทำkarolkozermorlutoGraphify-Labstt-a1icloudflare
จำนวน Skill11111
ดาว GitHub1,724461,751148,35296,75773,156
แก้โค้ดล่าสุด23 ส.ค. 256916 พ.ย. 256916 พ.ย. 256915 พ.ย. 256915 ก.ย. 2569
สัญญาอนุญาต–MITApache-2.0Apache-2.0MIT

ชุดคำสั่ง (Skill) 1 ชุดจาก karolkozer ให้ AI อ่านแล้วทำงานตามวิธีนี้ · ไม่ใช่ MCP server

Skill ต่างจาก MCP ยังไง

MCP = มือ

ต่อ AI เข้ากับบริการหรือข้อมูลข้างนอก เช่น อ่าน Notion หรือสร้างใบแจ้งหนี้ ต้องมีโปรแกรมหรือ server ทำงานอยู่

Skill = คู่มือ

ไฟล์ข้อความที่สอน AI ว่างานนี้ทำยังไง ไม่ต่อบริการใด

บางตัวคล้ายกัน: Skill บางตัวมีสคริปต์เรียกเครื่องมือ และ MCP บางตัวส่งแค่ความรู้ ให้ดูที่งานที่อยากทำเป็นหลัก

ใช้กับแอปไหน

Claude CodeCodexCursorGemini CLIWindsurf

ตามที่ README ของผู้ทำเขียนไว้ และโฟลเดอร์ที่มีใน repo

ติดตั้ง

ปลอดภัยไหม

  • ใครทำ

    บัญชี GitHub karolkozer (บุคคล) เปิดมา 9 ปี

  • คนใช้และการดูแล

    ★ 1,724 ดาว · แก้โค้ดล่าสุด 23 ส.ค. 2569

  • มีสคริปต์ไหม

    มีสคริปต์ 1 ไฟล์ที่รันบนเครื่องได้: examples/planby-emotion.d.ts

  • ใช้อินเทอร์เน็ตไหม

    ไม่พบคำสั่งเรียกอินเทอร์เน็ตในสคริปต์

  • แก้ค่าตั้งทั้งเครื่องไหม

    ไม่พบ hook หรือการเขียนค่าตั้งของเครื่อง

ตรวจอัตโนมัติจากไฟล์ใน repo ที่ commit 3d85c56 (อ่านไฟล์อย่างเดียว ไม่ได้รัน) ไม่ใช่การรับรองความปลอดภัย อ่านแล้วตัดสินใจเอง

ขั้นแรก: คุณใช้ AI ตัวไหน

เลือกแอปที่ใช้ แล้วหน้านี้จะแสดงเฉพาะวิธีติดตั้งของแอปนั้น

ทางที่ 1อัปโหลดเข้า claude.ai (เว็บและแอป)

  1. ดาวน์โหลดจาก GitHub

    Skill นี้ไม่ระบุใบอนุญาต เราจึงไม่แจกไฟล์ ZIP จากเว็บเรา ดาวน์โหลดจาก GitHub แล้วจัดโฟลเดอร์เอง หรือใช้ทาง "ให้ AI ติดตั้งให้" ด้านบนซึ่งง่ายกว่า

    ดาวน์โหลดจาก GitHub (ทั้ง repo) ↗

    แตกไฟล์ แล้วบีบอัดเฉพาะโฟลเดอร์ skills/planby ใหม่ ZIP ต้องมีโฟลเดอร์ planby ที่มี SKILL.md อยู่ชั้นบนสุด ห้ามวางไฟล์หลวมไว้ชั้นบนสุด

  2. เปิดหน้า Skills ใน claude.ai แล้วอัปโหลด

    +Create skillUpload a skillเลือกไฟล์ planby.zip

    เปิด claude.ai/customize/skills ↗

  3. ไม่เห็นปุ่ม Upload: เปิดสิทธิ์สร้างไฟล์ก่อน

    SettingsCapabilitiesCode execution and file creation

    ต้องเปิด Code execution and file creation ก่อน (เมนูรุ่นใหม่เรียก Create and edit files) · แผนส่วนตัวที่ Settings → Capabilities · Team/Enterprise ผู้ดูแลเปิดที่ Organization settings → Plugins & skills · ใช้ได้ทุกแผนรวมแผนฟรี

อัปโหลดครั้งเดียว ใช้ได้ทั้ง claude.ai และ Claude Desktop รวมถึง Claude Code รุ่นใหม่ที่ล็อกอินด้วยบัญชี Claude (ล็อกอินด้วยคีย์ API ไม่ซิงก์)

Cowork และ session บนคลาวด์ใช้ Skill ที่เปิดในบัญชี claude.ai ไม่อ่าน ~/.claude/skills ในเครื่อง (งานตั้งเวลาของ Claude Desktop ที่รันในเครื่องยังอ่านได้)

ตรวจกับเอกสารทางการล่าสุด 12 พ.ย. 2569 · แหล่ง: support.claude.com, support.claude.com, code.claude.com

ทางที่ 1ให้ Claude Code ติดตั้งให้

คัดลอกประโยคนี้ไปวางในแชตของ Claude Code

ติดตั้งไว้ที่ไหน

กำลังตรวจคำสั่ง · ปุ่มคัดลอกจะขึ้นเมื่อตรวจผ่าน

กำลังตรวจคำสั่ง · ปุ่มคัดลอกจะขึ้นเมื่อตรวจผ่าน

เลือกเฉพาะโปรเจกต์ ให้วางในแชตที่เปิดอยู่ในโฟลเดอร์ของโปรเจกต์นั้น · AI จะบอก path ให้ดูก่อนติดตั้งเสมอ

AI จะบอกก่อนว่าจะทำอะไร และขออนุญาตคุณทุกขั้น

เปิด Claude Code ใหม่ แล้วพิมพ์ /planby หรือสั่งงานที่ตรงเรื่อง Claude จะเลือกใช้เอง

ตรวจกับเอกสารทางการล่าสุด 12 พ.ย. 2569 · แหล่ง: code.claude.com

สำหรับคนที่ใช้ Terminal

Skill คือคำสั่งที่ AI จะทำตาม อ่านไฟล์ก่อนติดตั้ง และติดตั้งเฉพาะจากผู้ทำที่เชื่อถือได้

วิธีที่ผู้ทำแนะนำ

ลง Node.js ในเครื่อง (ถ้ายังไม่มี)

ลงไว้แล้วหรือยัง? เช็กก่อน · เปิด Terminal แล้วพิมพ์คำสั่งนี้ กด Enter

node -v
  • ขึ้นเลขรุ่น เช่น v26.13.1 = ลงแล้ว ข้ามขั้นนี้ได้
  • ขึ้นว่า "command not found" (Windows ขึ้นว่า "is not recognized") = ยังไม่ได้ลง หรือเพิ่งลงแต่ยังไม่ได้ปิดแล้วเปิด Terminal ใหม่
เปิด Terminal ยังไง

Mac: กด ⌘ + Space พิมพ์ Terminal แล้วกด Enter

Windows: เปิดเมนู Start พิมพ์ Windows PowerShell แล้วกด Open

ยังไม่ได้ลง: เปิดหน้าดาวน์โหลดทางการ เลือกรุ่น LTS แล้วเลือกตัวติดตั้งแบบกดเอง: Mac ไฟล์ .pkg · Windows ไฟล์ .msi ดับเบิลคลิกแล้วกดถัดไปจนจบ ไม่ต้องใช้คำสั่ง curl

เปิดหน้าดาวน์โหลด Node.js ↗

ลงเสร็จแล้ว ปิด Terminal เปิดใหม่ แล้วพิมพ์คำสั่งเดิมอีกครั้ง ต้องขึ้นเลขรุ่น: node -v

ลงครั้งเดียว ใช้ได้กับทุกตัวที่ต้องใช้ Node.js

กำลังตรวจคำสั่ง · ปุ่มคัดลอกจะขึ้นเมื่อตรวจผ่าน

คำสั่งนี้คัดมาจาก README ของผู้ทำ จะดาวน์โหลดและรันโค้ดของผู้ทำ

  1. เปิด Terminal

    Mac: กด Command+Space พิมพ์ Terminal · Windows: คำสั่งด้านล่างใช้ใน PowerShell ไม่ได้ ให้ใช้ทาง “ให้ AI ติดตั้งให้” ด้านบนแทน

  2. คัดลอกโฟลเดอร์ skill ไปไว้ที่ ~/.claude/skills

    คำสั่งนี้ดาวน์โหลด repo ไว้ชั่วคราว แล้วคัดลอกเฉพาะโฟลเดอร์ที่มี SKILL.md

    กำลังตรวจคำสั่ง · ปุ่มคัดลอกจะขึ้นเมื่อตรวจผ่าน

  3. เปิด Claude Code ใหม่ แล้วพิมพ์ /planby หรือสั่งงานที่ตรงเรื่อง Claude จะเลือกใช้เอง

Skill ที่ติดตั้งเองใช้ได้ในแอป ChatGPT บนคอม, Codex CLI และส่วนขยาย Codex ใน IDE · ChatGPT บนเว็บและมือถือใช้ Skill ที่ติดตั้งเองไม่ได้ ใช้ได้เฉพาะ Skill ที่มากับปลั๊กอินในไดเรกทอรี

แอป ChatGPT บนคอม

แอป ChatGPT บนคอมมี Codex อยู่ในตัว Codex อ่าน Skill จากโฟลเดอร์ ~/.agents/skills

ทางที่ 1ให้ ChatGPT ติดตั้งให้

เปิด Codex ในแอป ChatGPT บนคอม แล้ววางประโยคนี้ในแชต

ติดตั้งไว้ที่ไหน

กำลังตรวจคำสั่ง · ปุ่มคัดลอกจะขึ้นเมื่อตรวจผ่าน

กำลังตรวจคำสั่ง · ปุ่มคัดลอกจะขึ้นเมื่อตรวจผ่าน

AI จะบอก path ให้ดูก่อนติดตั้งเสมอ

AI จะบอกก่อนว่าจะทำอะไร และขออนุญาตคุณทุกขั้น

ทางที่ 2วางโฟลเดอร์เอง

วางโฟลเดอร์ planby ไว้ที่ ~/.agents/skills/planby

~ คือโฟลเดอร์บ้านของคุณ ($HOME)

สำหรับคนที่ใช้ Terminal

Skill คือคำสั่งที่ AI จะทำตาม อ่านไฟล์ก่อนติดตั้ง และติดตั้งเฉพาะจากผู้ทำที่เชื่อถือได้

  1. เปิด Terminal

    Mac: กด Command+Space พิมพ์ Terminal · Windows: คำสั่งด้านล่างใช้ใน PowerShell ไม่ได้ ให้ใช้ทาง “ให้ AI ติดตั้งให้” ด้านบนแทน

  2. คัดลอกโฟลเดอร์ skill ไปไว้ที่ ~/.agents/skills

    คำสั่งนี้ดาวน์โหลด repo ไว้ชั่วคราว แล้วคัดลอกเฉพาะโฟลเดอร์ที่มี SKILL.md

    กำลังตรวจคำสั่ง · ปุ่มคัดลอกจะขึ้นเมื่อตรวจผ่าน

หลังติดตั้ง

  • แอป ChatGPT บนคอม: เปิด Skills ในแถบข้างเพื่อดูว่า Skill ขึ้นแล้ว
  • เรียกใช้: ใน ChatGPT พิมพ์ @ แล้วเลือก Skill · ใน Codex CLI หรือส่วนขยายใน IDE พิมพ์ /skills หรือพิมพ์ $ แล้วตามด้วยชื่อ Skill
  • Codex เห็น Skill ที่ติดตั้งใหม่เอง ถ้ายังไม่ขึ้นให้ปิดแล้วเปิด Codex ใหม่

ตรวจกับเอกสารทางการล่าสุด 15 พ.ย. 2569 · แหล่ง: learn.chatgpt.com

ChatGPT บนเว็บและมือถือ

ใช้ Skill ที่ติดตั้งเองไม่ได้ ใช้ได้เฉพาะ Skill ที่มากับปลั๊กอินในไดเรกทอรี

อยากใช้ Skill นี้กับ ChatGPT ให้ใช้แอป ChatGPT บนคอมตามวิธีด้านบน

ตรวจกับเอกสารทางการล่าสุด 15 พ.ย. 2569 · แหล่ง: learn.chatgpt.com

ทางที่ 1ให้ Codex ติดตั้งให้

คัดลอกประโยคนี้ไปวางในแชตของ Codex · ใช้ได้ทั้ง Codex ในแอป ChatGPT บนคอม, Codex CLI และส่วนขยายใน IDE

ติดตั้งไว้ที่ไหน

กำลังตรวจคำสั่ง · ปุ่มคัดลอกจะขึ้นเมื่อตรวจผ่าน

กำลังตรวจคำสั่ง · ปุ่มคัดลอกจะขึ้นเมื่อตรวจผ่าน

เลือกเฉพาะโปรเจกต์ ให้วางในแชตที่เปิดอยู่ในโฟลเดอร์ของโปรเจกต์นั้น · AI จะบอก path ให้ดูก่อนติดตั้งเสมอ

AI จะบอกก่อนว่าจะทำอะไร และขออนุญาตคุณทุกขั้น

Codex เห็น Skill ที่ติดตั้งใหม่เอง ถ้ายังไม่ขึ้นให้ปิดแล้วเปิด Codex ใหม่ · เรียกใช้: ใน ChatGPT พิมพ์ @ แล้วเลือก Skill · ใน Codex CLI หรือส่วนขยายใน IDE พิมพ์ /skills หรือพิมพ์ $ แล้วตามด้วยชื่อ Skill

ตรวจกับเอกสารทางการล่าสุด 15 พ.ย. 2569 · แหล่ง: learn.chatgpt.com

สำหรับคนที่ใช้ Terminal

Skill คือคำสั่งที่ AI จะทำตาม อ่านไฟล์ก่อนติดตั้ง และติดตั้งเฉพาะจากผู้ทำที่เชื่อถือได้

  1. เปิด Terminal

    Mac: กด Command+Space พิมพ์ Terminal · Windows: คำสั่งด้านล่างใช้ใน PowerShell ไม่ได้ ให้ใช้ทาง “ให้ AI ติดตั้งให้” ด้านบนแทน

  2. คัดลอกโฟลเดอร์ skill ไปไว้ที่ ~/.agents/skills

    คำสั่งนี้ดาวน์โหลด repo ไว้ชั่วคราว แล้วคัดลอกเฉพาะโฟลเดอร์ที่มี SKILL.md

    กำลังตรวจคำสั่ง · ปุ่มคัดลอกจะขึ้นเมื่อตรวจผ่าน

  3. เปิด Codex ใหม่ แล้วสั่งงานที่ตรงเรื่อง Codex จะเห็น skill นี้ในรายการ

ทางที่ 1ให้ Cursor ติดตั้งให้

คัดลอกประโยคนี้ไปวางในแชตของ Cursor

ติดตั้งไว้ที่ไหน

กำลังตรวจคำสั่ง · ปุ่มคัดลอกจะขึ้นเมื่อตรวจผ่าน

กำลังตรวจคำสั่ง · ปุ่มคัดลอกจะขึ้นเมื่อตรวจผ่าน

เลือกเฉพาะโปรเจกต์ ให้วางในแชตที่เปิดอยู่ในโฟลเดอร์ของโปรเจกต์นั้น · AI จะบอก path ให้ดูก่อนติดตั้งเสมอ

AI จะบอกก่อนว่าจะทำอะไร และขออนุญาตคุณทุกขั้น

ใน Agent chat ของ Cursor พิมพ์ / แล้วเลือก planby

ตรวจกับเอกสารทางการล่าสุด 12 พ.ย. 2569 · แหล่ง: cursor.com

สำหรับคนที่ใช้ Terminal

Skill คือคำสั่งที่ AI จะทำตาม อ่านไฟล์ก่อนติดตั้ง และติดตั้งเฉพาะจากผู้ทำที่เชื่อถือได้

  1. เปิด Terminal

    Mac: กด Command+Space พิมพ์ Terminal · Windows: คำสั่งด้านล่างใช้ใน PowerShell ไม่ได้ ให้ใช้ทาง “ให้ AI ติดตั้งให้” ด้านบนแทน

  2. คัดลอกโฟลเดอร์ skill ไปไว้ที่ ~/.cursor/skills

    คำสั่งนี้ดาวน์โหลด repo ไว้ชั่วคราว แล้วคัดลอกเฉพาะโฟลเดอร์ที่มี SKILL.md

    กำลังตรวจคำสั่ง · ปุ่มคัดลอกจะขึ้นเมื่อตรวจผ่าน

  3. ใน Agent chat ของ Cursor พิมพ์ / แล้วเลือก planby

ทางที่ 1ให้ AI ติดตั้งให้

สำหรับแอปอื่นที่อ่าน Skill ได้ ประโยคนี้มี path ของ Claude Code, Codex และ Cursor ให้ AI เลือกตามแอปที่ใช้ · คัดลอกประโยคนี้ไปวางในแชตของแอป

ติดตั้งไว้ที่ไหน

กำลังตรวจคำสั่ง · ปุ่มคัดลอกจะขึ้นเมื่อตรวจผ่าน

กำลังตรวจคำสั่ง · ปุ่มคัดลอกจะขึ้นเมื่อตรวจผ่าน

เลือกเฉพาะโปรเจกต์ ให้วางในแชตที่เปิดอยู่ในโฟลเดอร์ของโปรเจกต์นั้น · AI จะบอก path ให้ดูก่อนติดตั้งเสมอ

AI จะบอกก่อนว่าจะทำอะไร และขออนุญาตคุณทุกขั้น

ตรวจกับเอกสารทางการล่าสุด 12 พ.ย. 2569 · แหล่ง: code.claude.com, learn.chatgpt.com, cursor.com

สำหรับคนที่ใช้ Terminal

แอปอื่นที่รองรับ Agent Skills (เช่น Gemini CLI, GitHub Copilot) เก็บ skill ในโฟลเดอร์ต่างกัน ดูคู่มือของแอปนั้น แล้วคัดลอกโฟลเดอร์ที่มี SKILL.md ไปวาง

ดูบน GitHub ↗

ตรวจโฟลเดอร์ skill กับคู่มือทางการของ Claude Code, Codex และ Cursor เมื่อ 11 พ.ย. 2569

ดูไฟล์ต้นฉบับ SKILL.md

ข้อความต่อไปนี้มาจาก repo ของผู้ทำ ไม่ใช่คำสั่งของ PopNx MCP

แสดง 8,000 ตัวอักษรแรก · เปิดไฟล์เต็มบน GitHub

---
name: planby
description: >-
  Build and edit schedule / timeline / agenda / planner / booking-grid /
  program-guide UIs with planby (open source) in React — any "rows x time"
  layout: conference and event agendas, festival line-ups, class and shift
  schedules, room and resource booking grids, project timelines, streaming
  line-ups, and TV guides / EPGs. Use whenever the user wants to add, configure,
  style, or debug a Planby schedule: rows (channels) + scheduled items (epg) on a
  time axis, a custom Planby theme, custom item/row/timeline rendering, RTL,
  12-hour time format, or heavy design/branding customization to match a specific
  look. Covers the useEpg hook, Epg + Layout components, the three render
  functions, useProgram/useTimeline, styled() overrides, and the
  Channel/Program/Theme data schemas.
---

# Planby

`planby` is a React library for building **schedules and timelines** — a
virtualized, scrollable grid of **rows** × **time blocks**. Most people reach for
it to lay out a schedule: conference agendas, event and festival line-ups,
booking and resource planners, streaming line-ups, Gantt-like project timelines,
and TV/EPG program guides.

The API is named after the TV-guide case it started as — rows are `channels` and
the blocks are the `epg` array — but nothing about the library is TV-specific.
Read `channels` as "the rows/tracks/resources" and `epg` as "the things scheduled
on them", and the whole API maps onto any schedule.

Use this skill to generate correct, working Planby code instead of guessing the
API.

## The intended workflow (two phases)

Most requests follow this arc — handle them in order:

**Phase 1 — "Build me a schedule / timeline / EPG."**
Get something on screen first:
1. Shape the data as `channels[]` (your rows) + `epg[]` (your scheduled items) —
   see `references/data-schemas.md`.
2. Wire `useEpg` + `<Epg><Layout/>` following the 4 rules below.
3. Ship the default look — don't over-style yet.
→ Read `references/quick-start.md`. Stop when it renders.

**Phase 2 — "Now customize it to my design / brand."**
Only after Phase 1 works. Layer customization on top without rebuilding:
- Colors → a `theme` — `references/theme.md`.
- Custom-looking parts → `references/render-functions.md`.
- Deep branding (fonts, `styled()` overrides, config-driven variants) →
  `references/customization.md`.

Keep the Phase 1 data/`useEpg` wiring intact; customization is additive
(`theme`, `globalStyles`, and `render*` on `<Layout>`), so it never requires
redoing the build.

Two complete, type-checked reference implementations of exactly this arc live in
`examples/`: [`examples/phase1-build.tsx`](examples/phase1-build.tsx) (the plain
build) and [`examples/phase2-branded.tsx`](examples/phase2-branded.tsx) (the same
guide re-skinned to a light brand). Use them as copy-from templates.

## When to use / when not

- **Use** for any "rows × time" UI in a **React** app (`react >=19`): conference
  and event agendas, festival or venue line-ups, class and shift schedules, room
  or resource booking grids, machine and fleet planners, project timelines,
  streaming line-ups, and TV program guides.
- **Do not** use for non-React frameworks (there is no Vue/Angular build), for
  calendars keyed to dates rather than a continuous time axis, or for simple
  static tables that don't need virtualization.

## Install

Public npm — no registry configuration needed.

```bash
yarn add planby
# or
npm install planby
```

Peer dependency: **`react >= 19`**.

## Minimal working example (the happy path)

Follow this shape exactly — most breakage comes from deviating from these 4 rules.

```tsx
import React from "react";
import { useEpg, Epg, Layout } from "planby";

export function Guide() {
  const channels = React.useMemo(
    () => [{ uuid: "channel-1", logo: "https://example.com/logo.png" }],
    []
  );

  const epg = React.useMemo(
    () => [
      {
        id: "program-1",
        channelUuid: "channel-1",        // MUST match a channel.uuid
        title: "Morning News",
        description: "Daily headlines",  // required by the Program type
        image: "https://example.com/img.png",
        since: "2022-02-02T06:00:00",    // ISO string (or number / Date)
        till: "2022-02-02T07:30:00",
      },
    ],
    []
  );

  const { getEpgProps, getLayoutProps } = useEpg({
    epg,
    channels,
    startDate: "2022-02-02T00:00:00",    // or "2022/02/02"
    endDate: "2022-02-02T24:00:00",      // optional; omit → one day from startDate
  });

  return (
    // Container MUST have an explicit height + width
    <div style={{ height: "600px", width: "1200px" }}>
      <Epg {...getEpgProps()}>
        <Layout {...getLayoutProps()} />
      </Epg>
    </div>
  );
}
```

### The 4 rules that must always hold

1. **`channels` and `epg` are memoized** (`React.useMemo` / stable refs). Passing
   fresh arrays every render causes remounts and lost scroll.
2. **`epg[].channelUuid` must equal some `channels[].uuid`** — otherwise the program
   never renders (it has no row).
3. **`since` / `till` are ISO strings** (`"2022-02-02T06:00:00"`), numbers, or
   `Date`. Keep them inside the `startDate`…`endDate` range.
4. **Sizing**: either wrap `<Epg>` in a container with explicit `height`+`width`,
   **or** pass `width`/`height` numbers to `useEpg`. Never leave it auto-sized.

> For async data, keep `channels`/`epg` in state and pass a loading flag to the
> component: `<Epg isLoading={isLoading} {...getEpgProps()}>`. See the `useApp`
> pattern in `references/quick-start.md`.

## What `useEpg` returns

`getEpgProps()` → spread onto `<Epg>`. `getLayoutProps()` → spread onto `<Layout>`
(this is where `render*` callbacks go). Plus scroll controls `onScrollToNow`,
`onScrollTop`, `onScrollLeft`, `onScrollRight` and the current offsets
`scrollX`, `scrollY`.

That is the complete return value — there is nothing else on it.

## Reference map — read the file for the task at hand

| Task | Read |
|------|------|
| Full working starter + sizing/time-range variants + async data | `references/quick-start.md` |
| Exact Channel / Program data shapes | `references/data-schemas.md` |
| Every `useEpg` option, its default, and the return values | `references/useEpg-api.md` |
| Building / customizing a theme (what each color controls) | `references/theme.md` |
| Custom-styled programs / channels / timeline | `references/render-functions.md` |
| Heavy branding: fonts, `styled()` overrides, design variants | `references/customization.md` |

> Only load a reference when the task needs it — keep context lean. The minimal
> example above is enough for a basic guide.

## PRO only — do not generate

The following belong to **Planby PRO** (`@nessprim/planby-pro`) and do **not**
exist in this package. `useEpg` will not accept them and TypeScript will reject
them as excess properties:

`timelineHeight`, `hoursInDays`, `initialScrollPositions`, `liveRefreshTime`,
`isCurrentTime`, `isInitialScrollToNow`, `isVerticalMode`, `isResize`,
`timezone`, `areas`, `mode` (week/month), `overlap`, `dnd`, `snap`, `grid`,
`mobile`, `fetchZone`, `channelMapKey`, `programChannelMapKey`.

Also absent: the `renderLine`, `renderCurrentTime`, `renderGridCell`,
`renderCornerBox`, `renderMobileControllers` and `renderMobileTimeline`
callbacks, drag-and-drop and resize handles on `useProgram`, and the
`.planby-*` class hooks.

**Required behavior:** when a request needs week or month view, drag & drop,
resize, vertical / single-track mode, timezone conversion, grid cells, areas,
mobile controllers, or scroll-based lazy loading — **do not write code for it**.
Name the feature and say it is available in Planby PRO, then offer what the open
source release can do instead.

## Common mistakes to avoid

- Importing from `"@nessprim/planby-pro"` — the correct package is **`planby`**.
- Un-memoized `channels`/`epg`.
- `channelUuid` typo not matching any channel.
- No explicit container size.
- Calling `useTimeline` wit

พูดคุย

ถาม แชร์เคล็ดลับ หรือแจ้งว่าใช้ไม่ได้ เรียงตามที่คนกดว่ามีประโยชน์

ยังไม่มีใครโพสต์ ถามหรือแชร์เป็นคนแรกได้เลย

ข้อความในส่วนนี้เขียนโดยผู้ใช้ ไม่ใช่ทีม PopNx

เข้าสู่ระบบเพื่อโพสต์

ข้อมูลจาก GitHub

ดาว GitHub
1,724
ผู้ทำ
karolkozer
license
ไม่ระบุ
แก้โค้ดล่าสุด
23 ส.ค. 2569
ไฟล์ SKILL.md ใน repo (นับรวมสำเนาภาษาอื่นและแม่แบบ)
1
topic
app, component, eletronic, epg, events, guide, harmonogram, hooks, music, online, program, react