Lab: Custom Components Preview

Preview the custom Markdown components used by this blog theme, with usage notes and source examples.
Metadata

This page previews the custom components available in this blog theme. Each section shows the rendered component first, then the Markdown or HTML needed to reproduce it.

Image groups use Markdown fences and load automatically in articles. Other components use custom HTML elements; load their matching module when needed.

Use this page as a quick reference, but keep the components purposeful in real posts. A component should make structure, comparison, or context clearer. If plain Markdown communicates the idea better, use plain Markdown.

Tabs

Tabs are useful when the reader needs to compare related views without scrolling through repeated sections. In this page, each component uses tabs to separate the live preview from the source Markdown.

Keep tab labels short. Add active to the default <x-tab>, and use one <x-tab title="..."> per panel. Leave blank lines around tab content, especially when the content contains Markdown blocks or custom HTML.

Image Group

Use an image group for photos from the same place, observation or comparison. An image-group Markdown fence fixes the number of rows and scrolls horizontally; no script tag is required, and images remain scrollable without JavaScript.

rows fixes the row count while columns extend to the right; it defaults to 1. With rows=2, images are split into consecutive rows that each pack left to right. Rows scroll together without aligned columns; different image widths only leave the configured gap. mobile-rows defaults to 1 when the group is 480px wide or narrower. Explicit columns opts into a fixed-column grid; rows takes precedence when both are set. Use gap for spacing, height for each image’s height, and label for the accessible name. Images retain their full composition with transparent empty space. The group has no footer, navigation buttons or autoplay.

Captions appear inside the bottom of the image on hover or keyboard focus, over a gradient. Click or focus an image and press Enter to open its fullscreen preview; touch readers can read captions in the preview. Left/Right or touch swipes change the preview; Escape closes it and restores focus. Focus the scrolling rail to use Left/Right or Home/End for horizontal navigation.

登山
登山
渔村
渔村
山,海,船
山,海,船
映山湖与海
映山湖与海
```image-group rows=1 label="Zhushan Xiugu photos"![登山](https://assets.vluv.space/登山者.avif)![渔村](https://assets.vluv.space/珠山秀谷-珠山海边村落.avif)![山,海,船](https://assets.vluv.space/山海.avif)![映山湖与海](https://assets.vluv.space/映山湖与海.avif)```

Text Image Section

Use a text image section when an image and a paragraph need to be read together. It is better than a standalone image when the picture provides context for a person, place, quote, or historical note.

Load /js/components/text-image-section.LIZOPA4N.js before the component. Provide a meaningful alt value, set width deliberately, and keep the text focused. Long text can work, but the component reads best when the image and copy form one compact unit.

The image renders as a <figure> (with the alt text reused as a <figcaption>) floated to the right of the text by default; add the left attribute to flip the layout. On screens narrower than 640px the figure stacks above the text full-width. Internally the host element creates its own block formatting context, so a parent <blockquote> that Hexo wraps around >-prefixed Markdown lines won’t bleed its left border into the image area on mobile.

Hermann Karl Hesse (2 July 1877 – 9 August 1962) was a German-Swiss poet and novelist, and winner of the 1946 Nobel Prize in Literature. His interest in Eastern religious, spiritual, and philosophical traditions, combined with his involvement with Jungian analysis, helped to shape his literary work. His best-known novels include Demian, Steppenwolf, Siddhartha, Narcissus and Goldmund, and The Glass Bead Game, each of which explores an individual’s search for authenticity, self-knowledge, and spirituality.

<script type="module" src="/js/components/text-image-section.LIZOPA4N.js"></script><text-image-section image="https://www.chinawriter.com.cn/mediafile/pic/20221202/66/17616500808839860178.jpg" alt="Hermann Hesse" width="200px" font-size="1.1rem" font-family="var(--font-handwritten)">**Hermann Karl Hesse** (2 July 1877 – 9 August 1962) was a German-Swiss poet and novelist, and winner of the 1946 Nobel Prize in Literature. His interest in Eastern religious, spiritual, and philosophical traditions, combined with his involvement with Jungian analysis, helped to shape his literary work. His best-known novels include Demian, Steppenwolf, Siddhartha, Narcissus and Goldmund, and The Glass Bead Game, each of which explores an individual's search for authenticity, self-knowledge, and spirituality.</text-image-section>

Accordion 🪗

Use an accordion for long optional explanations. It keeps the main page readable while still allowing interested readers to expand details.

Use native <details class="accordion-item" name="..."> with <summary> directly. Details in the same accordion share the same name; import /css/optional/accordion.IVAP6VWR.css where used, with no extra JS required.

Headings

Use # to create headings. The count of # determines the level. Markdown supports six heading levels, corresponding to <h1> through <h6>. Typically a post has one top-level heading as the page title, and body content starts from level two.

# Heading 1## Heading 2### Heading 3
Text Styles

Use **bold** and *italic* for emphasis. Strikethrough uses ~~text~~. Inline code wraps in backticks, e.g. `code`.

These styles can be combined freely:

  • bold **text**
  • italic *text*
  • strikethrough ~~text~~
  • inline code `code`
Links & Images

Link syntax is [text](URL). Images add a ! prefix: ![alt text](URL).

[OpenAI](https://openai.com)![Logo](https://example.com/logo.png)

URLs also support reference-style notation, useful when the same link appears multiple times.

<div class="accordion"><details class="accordion-item" name="accordion-test_components-en-example-1">  <summary>Headings</summary>  Use `#` to create headings. The count of `#` determines the level. Markdown supports six heading levels, corresponding to `<h1>` through `<h6>`. Typically a post has one top-level heading as the page title, and body content starts from level two.  ```md  # Heading 1  ## Heading 2  ### Heading 3  ```</details><details class="accordion-item" name="accordion-test_components-en-example-1">  <summary>Text Styles</summary>  Use `**bold**` and `*italic*` for emphasis. Strikethrough uses `~~text~~`. Inline code wraps in backticks, e.g. `` `code` ``.  These styles can be combined freely:  - **bold** `**text**`  - *italic* `*text*`  - ~~strikethrough~~ `~~text~~`  - `inline code` `` `code` ``</details><details class="accordion-item" name="accordion-test_components-en-example-1">  <summary>Links &amp; Images</summary>  Link syntax is `[text](URL)`. Images add a `!` prefix: `![alt text](URL)`.  ```md  [OpenAI](https://openai.com)  ![Logo](https://example.com/logo.png)  ```  URLs also support reference-style notation, useful when the same link appears multiple times.</details></div>

File Tree 🌳

Use a file tree when directory structure is part of the explanation. It is especially useful for themes, scripts, generated assets, and small project layouts.

Load /js/components/tree.D6TVEZ7G.js before the component. Use root to name the top-level directory. Inside <x-tree>, write each entry as a Markdown list item and use two spaces for each nesting level. Add a trailing / when a folder has no listed children, so the component can still render it as a folder. Keep the tree small enough to scan.

  • source/
    • js/
      • components/
        • accordion.css
        • tree.js
        • image-group.js
      • main.js
    • css/
      • style.css
      • themes/
        • nord.css
        • catppuccin.css
    • images/
      • logo.png
  • scripts/
  • package.json
  • README.md
  • hexo.config.js
<script type="module" src="/js/components/tree.D6TVEZ7G.js"></script><x-tree root="gnix-theme">- source/  - js/    - components/      - accordion.css      - tree.js      - image-group.js    - main.js  - css/    - style.css    - themes/      - nord.css      - catppuccin.css  - images/    - logo.png- scripts/- package.json- README.md- hexo.config.js</x-tree>

Side Note

Use a side note when supporting context should stay near the paragraph it explains without interrupting the main reading flow. It is useful for short definitions, source quotes, caveats, or implementation notes.

Load /js/components/sidenote.2RIQQL5Z.js before the component. Place <side-note> immediately after the paragraph or block it annotates. On wide screens the note moves into the right margin and multiple notes are measured so they do not overlap; on smaller screens it falls back into the normal article flow.

This paragraph introduces the main claim. The side note below adds context without forcing the reader to leave the sentence they are reading.

Side notes sit in the article margin on wide screens. They are best kept short and focused.

This second paragraph has another side note, which demonstrates that stacked notes avoid each other instead of sharing the same top position.

If two notes would collide, the later one is pushed down while staying close to its anchor paragraph.

<script type="module" src="/js/components/sidenote.2RIQQL5Z.js"></script>This paragraph introduces the main claim. The side note below adds context without forcing the reader to leave the sentence they are reading.<side-note>Side notes sit in the article margin on wide screens. They are best kept short and focused.</side-note>This second paragraph has another side note, which demonstrates that stacked notes avoid each other instead of sharing the same top position.<side-note>If two notes would collide, the later one is pushed down while staying close to its anchor paragraph.</side-note>

Chat 💬

Use the chat component when a question-and-answer format makes the explanation easier to follow. It works well for debugging notes, AI-assisted explanations, and short conversations where the sequence matters.

Load /js/components/chat.BR2XQ3SA.js before the component. Each <chat-message> should include a name; avatar and timestamp are optional but help the conversation feel structured. Add is-me to align the author’s own message. Keep each message concise, or the chat layout will become harder to scan than normal prose.

The layout uses a two-row grid: avatar and header (name + timestamp) sit on the first row, with the message bubble on the second. On mobile the bubble drops to a full-width row below the header, so the avatar no longer eats horizontal space. Inline <code>, <kbd>, lists, and code blocks inside the bubble pick up dedicated styles that don’t leak out of the shadow DOM.

Hey everyone! How's the project going? Going well! Just finished the authentication module. Nice! We're using JWT tokens with refresh token rotation. Here's the basic structure: auth.refreshToken.rotate() Awesome work! Can't wait to see the PR
<script type="module" src="/js/components/chat.BR2XQ3SA.js"></script><x-chat>  <chat-message name="Alice" avatar="https://api.dicebear.com/7.x/avataaars/svg?seed=Alice" timestamp="10:30">    Hey everyone! How's the project going?  </chat-message>  <chat-message name="Bob" avatar="https://api.dicebear.com/7.x/avataaars/svg?seed=Bob" timestamp="10:32">    Going well! Just finished the authentication module.  </chat-message>  <chat-message name="Charlie" avatar="https://api.dicebear.com/7.x/avataaars/svg?seed=Charlie" timestamp="10:35">    Nice! We're using JWT tokens with refresh token rotation. Here's the basic structure:    <code>auth.refreshToken.rotate()</code>  </chat-message>  <chat-message name="GnixAij" avatar="https://api.dicebear.com/7.x/avataaars/svg?seed=GnixAij" timestamp="10:38" is-me>    Awesome work! Can't wait to see the PR  </chat-message></x-chat>

Read More