06 / COMPONENTS
Components
Native interface elements with independent theme previews, markup, selectors, and source references.
Agent Instructions / components
You are composing a current-shell KIRUPA page. Read /design/components.json and the relevant entry in /design/sections/components.md for selectors, variants, source files, and usage. Start from an adjacent working page and reuse its SSI structure and named component classes. When a link needs to look like a link inside the tutorial body, add the blueEmphasis class to its anchor, including in component examples. Style class names, IDs, and code identifiers in explanatory prose with inlineCode. Choose semantic HTML before adding JavaScript. Use visible labels, keyboard-operable controls, clear focus, and explicit loading/error/empty states. Keep forms inert in documentation specimens and label demo output. Preserve the article's reading rhythm and code overflow containment. Verify the component in each visual style and both modes. Do not initialize onboarding, tracking, a live chat request, or a subscription in a preview. Keep reference and navigation descriptions short and factual. Follow WCAG 2.2 AA for new or changed content: semantic HTML, keyboard access, visible focus, readable contrast in every theme, text alternatives, labeled controls, and explicit errors. Support zoom/reflow, respect reduced motion, and keep sound optional. Read /design/sections/accessibility.md for acceptance checks. Report unresolved barriers; automated checks alone do not establish conformance.
Current articles use #mainBody, #mainContent, #tutorialInformation, .authorText, .tutorialInfo, and the shared shell includes. Reuse .kirupaButton, .kirupaInput, .inlineCode, .blueEmphasis, .callout, .articleList, .smileysTable, and .embed-container instead of drawing near-duplicates.
Use .blueEmphasis on anchors that need the standard link treatment inside tutorial body content, including links in component examples. Keep their text descriptive. Use .inlineCode when naming CSS classes, IDs, or code identifiers in the explanation.
Example: Use the reading classes directly
Give the identifier its inline-code treatment and the destination its link treatment.
<p>Change <span class="inlineCode">count</span>, then
<a class="blueEmphasis" href="/html5/building_your_first_web_page.htm">try the example</a>.
</p>Use real buttons for actions, anchors for destinations, visible input labels, scope on table headers, and a caption or accessible name for tables. Focus is a state, not an optional decoration. Label disabled controls and empty states so readers understand what can happen next.
Buttons and form states
LOCAL PREVIEWActivate this specimen to load its real styles. No saved preferences change.
Tutorial content has a title and byline, a reason to care, an example, and a clear progression. Code and illustrations must agree. Long examples can scroll inside their own container; the whole page must not become a sideways adventure. Here is a reading detail from Building Your First Interactive Web Page:
Reading patterns in a real tutorial

The screenshot could not load. Open the live example or the full-size image below.
The theme picker is a dialog with color swatches, a custom color, mode choices, and style cards. Onboarding is a separate once-only interaction that can record choices. These are production behaviors, not things to initialize when showing an innocent design preview.
The catalog below covers shared article patterns, navigation, book and newsletter promotions, theme controls, search, chat, media, and the visitor globe. Each entry identifies its implementation and any preview limitations. Tutorial-specific games and visualizers, legacy Flash interfaces, and third-party Discourse internals are outside this shared-component catalog. Preview actions stay local; they never submit a subscription, chat message, search query, or presence event to production.
For compact contextual popups, follow the Who's Online location dialog: a short heading, descriptive destination links, and an X close icon at the top-right, not a trailing Close text link. Use a real button with the accessible name Close and a 32px square target, inset 6px from the top and right. Reserve heading space so long labels cannot run beneath it. This is a contextual-choice pattern, not a replacement for modal confirmation or long forms.
The location popup uses a 280px-wide panel, 16px inner padding, a 2px --structureBorder outline, 12px corners, and a quiet 4px offset shadow. Reuse --pageBackground, --bodyText, --primary, and --serifFonts so it follows all nine styles and light/dark modes. Anchor it beside its trigger with an 8px gap; flip above when needed and keep at least 8px clear of viewport edges. Cap its height and scroll the panel rather than overflowing the page.
Use a button trigger with aria-haspopup="dialog", aria-controls, and synchronized aria-expanded; name the non-modal dialog with its heading. Move focus to the first link on open. Escape or the close icon returns focus to the trigger; outside click or focus dismisses without stealing focus. Tab and Shift+Tab can leave without a focus trap. Preserve the active interaction across live refreshes and dismiss safely if its source disappears. Reuse .clay-location-popover and .clay-location-close as the source reference; do not copy private visitor data into a specimen.
- Do keep labels short, specific, and verb-led: Play, Stop, Download, Copy instructions.
- Do distinguish loading, empty, success, and error states in text, not color alone.
- Do put a labeled close-icon button at the top-right of compact contextual popups, with space for the heading and a visible focus ring.
- Do not turn every paragraph into a card or use arbitrary decorative separators.
Current shared tutorial elements, homepage and podcast cards, promotions, navigation, theme controls, and signature widgets. Examples reuse native CSS and extracted source markup. Lesson-specific demos, legacy Flash layouts, and the forum's Discourse themes are not a shared component library. Download component metadata.
Reading
- Article title and metadata Native article title, its date stamp, author block, and Filed under metadata.
- Headings, links, code, and emphasis Article heading levels and inline treatments using the site's existing selectors.
- Buttons and size variants Primary actions, the historical greenButton alias, and the compact button modifier.
- Article lists and ordered steps Native linked topic lists, ordinary bullet lists, and ordered instructions.
- Data tables Bordered comparison tables, such as the Big-O tables in the sorting and data structure tutorials.
- Colorful pills Short, colorful uppercase labels in a row, such as the Illustrated, Citeable, and Agent-friendly tagline at the top of the agents guide.
- TL;DR A collapsible short answer and three or four key takeaways right under an article's title. It starts closed, and its text stays in the page for search engines, AI answers, and find-in-page.
- Example guide How to use a live demo, in one quiet two-tone example region: the demo on a slightly deeper tint, then a TRY IT label, a few numbered steps at body size, bold control chips, and keycaps. It replaces tiny gray instruction text under examples.
- Archive note A short note near the top of a Flash, Silverlight, or WPF-era tutorial. Archive marks a page kept for history and taken out of search; Modern version points a still-visited page at the closest current HTML, CSS, and JavaScript article.
- FAQ A short list of real questions people ask about an article's topic, each a collapsible native details with a site icon, placed just above the Conclusion. Its text stays in the page and matches the page's FAQPage JSON-LD.
- Before you go (next steps) The conclusion's short "Before you go, here are a few things you can do:" list: take the quiz, keep reading (the next lesson plus a few related links), and ask on the forums. Written as part of the prose, with thin rules between the steps.
- Notes, downloads, and archive notices Three existing callout patterns with different purposes.
- Syntax-highlighted code Native Prism code presentation, including real highlighting and overflow behavior.
- Images and embedded-media frames Bordered images, borderless artwork, and the shared iframe frame.
Promotions
Navigation
- Header and utility controls KIRUPA branding, animated background, visitor count, and header controls. The More hamburger exposes ten extra destinations on desktop, including Icon Gallery, also available in the mobile menu.
- Tutorial left navigation Native section headings, topic links, and current-article state.
- Homepage Fresh from the workshop list The home page's first numbered section, set like every other section under a heavy rule with no paper behind it, listing the newest articles and newsletter issues together, newest first, each with its icon, date, and kind, and a link to the last 15 updates.
Widgets
- Theme customizer Native style cards, palette swatches, custom-color input, mode controls, and the Background icons and Content reveals choices.
- Search dialog The real search interface with a local result provider and keyboard navigation.
- kirupaBot launcher and chat panel Launcher, welcome message, composer, answer, loading, and error states.
- Visitor globe and table Real globe renderers, a semantic visitor table, and compact contextual location popups.
Media
- Podcast index card Episode artwork, guest name, title, date, and duration.
- Episode media A real interview cover in a locally themed media context.
- Short-form video and captions Caption placement and real portrait or square video reference frames.
- Forum post structure Author identity, post content, code, spacing, and visible bot labeling.