Skip to content

Twitch panelsNew

About, Instagram, Twitter, Discord, subs, and donations. White field, black type, a colored mark beside each title, and the pine forest along the bottom. Download a PNG for each and upload them in Twitch’s About section.

About

About me

A caffeinated beverage.

Social

Instagram

@chandler.t.king

Social

Twitter

@chandlerking

Social

Discord

Come say hey

Perks

Subs

Exclusive emotes

Crown and Fair badge

First dibs

No ads

Giveaways

Support

Donations

All donations will go toward improving the quality of the stream. Thank you.

import { OverlayRoot } from "@/components/stream/overlay-root";
import { PANEL_MARK_SVG, type PanelMarkId } from "@/config/stream-panel-marks";
import { TWITCH_PANELS, type TwitchPanel } from "@/config/stream-panels";
import { footerConfig, siteConfig } from "@/config/site";
import type { StreamLayout } from "@/config/stream-components";
import styles from "./twitch-panels.module.css";

function hasLines(panel: TwitchPanel): panel is TwitchPanel & { lines: readonly string[] } {
  return "lines" in panel;
}

const COFFEE = "/images/profile-stickers/coffee.webp";

function Mark({ id }: { id: TwitchPanel["id"] }) {
  switch (id) {
    case "about":
      return (
        // eslint-disable-next-line @next/next/no-img-element
        <img
          src={siteConfig.personal.avatar.src}
          alt=""
          className={styles.glyph}
          draggable={false}
        />
      );
    case "donations":
      return (
        // eslint-disable-next-line @next/next/no-img-element
        <img src={COFFEE} alt="" className={styles.glyph} draggable={false} />
      );
    case "instagram":
    case "twitter":
    case "discord":
    case "subs":
      return <Logo id={id} />;
    default: {
      const unreachable: never = id;
      return unreachable;
    }
  }
}

function Logo({ id }: { id: PanelMarkId }) {
  return <span className={styles.mark} dangerouslySetInnerHTML={{ __html: PANEL_MARK_SVG[id] }} />;
}

function Panel({ panel }: { panel: TwitchPanel }) {
  return (
    <article className={styles.panel}>
      {/* eslint-disable-next-line @next/next/no-img-element */}
      <img
        src={footerConfig.artwork.src}
        alt=""
        width={footerConfig.artwork.width}
        height={footerConfig.artwork.height}
        draggable={false}
        className={styles.forest}
      />
      <div className={styles.content}>
        <p className={styles.eyebrow}>{panel.eyebrow}</p>
        <div className={styles.heading}>
          <Mark id={panel.id} />
          <h3 className={styles.title}>{panel.title}</h3>
        </div>
        {"body" in panel ? <p className={styles.body}>{panel.body}</p> : null}
        {hasLines(panel) ? (
          <div className={styles.card}>
            {panel.lines.map((line) => (
              <p key={line} className={styles.line}>
                {line}
              </p>
            ))}
          </div>
        ) : null}
      </div>
    </article>
  );
}

export function TwitchPanels({
  layout,
}: {
  layout: StreamLayout;
  preview?: boolean;
}) {
  return (
    <OverlayRoot>
      <div className={styles.set} data-layout={layout}>
        {TWITCH_PANELS.map((panel) => (
          <Panel key={panel.id} panel={panel} />
        ))}
      </div>
    </OverlayRoot>
  );
}

Props

Size

Still image, 320 × 400. Six panels. Upload each PNG in Twitch’s About section.

Installation

Twitch panels is a still 320 × 400 PNG. Six panels. Upload each PNG in Twitch’s About section.

Usage

example.tsx

import { TwitchPanels } from "@/components/stream/twitch-panels";

export function Overlay() {
  return <TwitchPanels layout="desktop" />;
}

Browser source

Paste this URL into OBS or TikTok Live Studio. The query params match the props below.

browser-source.tsx

// Still Twitch panels, 320×400. Download the PNGs and upload them in the About section.
const src = "https://chandlerking.dev/live/twitch-panels?layout=desktop";

Six footer-style panels in the same grid as the channel About page: about, Instagram, Twitter, Discord, subs, and donations. White field, black type, a colored mark beside each title, and the pine forest along the bottom.

Props

PropTypeDefaultNotes
layout"desktop" | "mobile"RequiredAccepted for the overlay switch. The panels themselves are a fixed 320×400.

Notes & Features

  • Download. Download saves six PNGs. Upload each one in Twitch’s panel slots, in the same order as the preview.
  • Footer. Every panel is the footer on a white card: black serif title, a colored mark beside it, and the pine forest holding the bottom.
  • Copy. The words live in the panel config. About reads “A caffeinated beverage.”

Manual installation

Rather than the browser source, copy Twitch panels into a project. Install its dependencies, then copy all 2 files into the matching path.

Source files

src/components/stream/twitch-panels.tsx

import { OverlayRoot } from "@/components/stream/overlay-root";
import { PANEL_MARK_SVG, type PanelMarkId } from "@/config/stream-panel-marks";
import { TWITCH_PANELS, type TwitchPanel } from "@/config/stream-panels";
import { footerConfig, siteConfig } from "@/config/site";
import type { StreamLayout } from "@/config/stream-components";
import styles from "./twitch-panels.module.css";

function hasLines(panel: TwitchPanel): panel is TwitchPanel & { lines: readonly string[] } {
  return "lines" in panel;
}

const COFFEE = "/images/profile-stickers/coffee.webp";

function Mark({ id }: { id: TwitchPanel["id"] }) {
  switch (id) {
    case "about":
      return (
        // eslint-disable-next-line @next/next/no-img-element
        <img
          src={siteConfig.personal.avatar.src}
          alt=""
          className={styles.glyph}
          draggable={false}
        />
      );
    case "donations":
      return (
        // eslint-disable-next-line @next/next/no-img-element
        <img src={COFFEE} alt="" className={styles.glyph} draggable={false} />
      );
    case "instagram":
    case "twitter":
    case "discord":
    case "subs":
      return <Logo id={id} />;
    default: {
      const unreachable: never = id;
      return unreachable;
    }
  }
}

function Logo({ id }: { id: PanelMarkId }) {
  return <span className={styles.mark} dangerouslySetInnerHTML={{ __html: PANEL_MARK_SVG[id] }} />;
}

function Panel({ panel }: { panel: TwitchPanel }) {
  return (
    <article className={styles.panel}>
      {/* eslint-disable-next-line @next/next/no-img-element */}
      <img
        src={footerConfig.artwork.src}
        alt=""
        width={footerConfig.artwork.width}
        height={footerConfig.artwork.height}
        draggable={false}
        className={styles.forest}
      />
      <div className={styles.content}>
        <p className={styles.eyebrow}>{panel.eyebrow}</p>
        <div className={styles.heading}>
          <Mark id={panel.id} />
          <h3 className={styles.title}>{panel.title}</h3>
        </div>
        {"body" in panel ? <p className={styles.body}>{panel.body}</p> : null}
        {hasLines(panel) ? (
          <div className={styles.card}>
            {panel.lines.map((line) => (
              <p key={line} className={styles.line}>
                {line}
              </p>
            ))}
          </div>
        ) : null}
      </div>
    </article>
  );
}

export function TwitchPanels({
  layout,
}: {
  layout: StreamLayout;
  preview?: boolean;
}) {
  return (
    <OverlayRoot>
      <div className={styles.set} data-layout={layout}>
        {TWITCH_PANELS.map((panel) => (
          <Panel key={panel.id} panel={panel} />
        ))}
      </div>
    </OverlayRoot>
  );
}

src/components/stream/overlay-root.tsx

import type { ReactNode } from "react";

import { cn } from "@/lib/utils";

export function OverlayRoot({
  children,
  className,
}: {
  children: ReactNode;
  className?: string;
}) {
  return (
    <div
      className={cn(
        "@container relative h-full w-full overflow-hidden pointer-events-none",
        className,
      )}
    >
      {children}
    </div>
  );
}

Carve that warmth into me.

Vinland Saga
Chandler King

Building AnglerIQ & The Sozo CRM

Open to software engineering roles

Crafted by Chandler King · Kansas City, MO