c2n Web Components
v1.0.32Exact APIs, examples, theme tokens and markup validation for the c2n (c2-*) Lit web components.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_components List components
Lists every c2n component (tag, package, category, one-line description, installed version in the current project).
| Parameter | Type | Description |
|---|---|---|
category | string | Only this category |
format | string | Output format |
installedOnly | boolean | Only packages installed in the current project |
keyword | string | Substring filter on tag, title or description |
get_component Get component API
Full API of one component: install/import lines, attributes, script-only properties (renderers, data sources) and methods, slots, events, native CSS parts, CSS variables grouped by semantic target and state (with the theme token each follows), composition and preset names. A long answer is shortened to fit one response and says how to ask for the rest; pass `include` for one section in full. Examples are served by get_examples.
| Parameter | Type | Description |
|---|---|---|
tag * | string | Component tag, id or package: `c2-button`, `button`, `@c2n/button`, `c2-tab`, or a concrete icon tag such as `c2-feather-arrow-right` |
format | string | Output format |
include | array | Sections to include (default: all) |
search_components Search components
Free-text search across component names, descriptions, intents (what each component is for), attributes, slots, events, example labels and, for a query about icons or one that is an icon name, icon names. Use it to find the component for a UI need, worded as a requirement or a widget name ("let users turn a setting on or off", "dropdown", "avatar with status", "arrow icon").
| Parameter | Type | Description |
|---|---|---|
query * | string | What you are looking for |
limit | integer |
get_examples Get examples
Markup examples of a component: usage rows from the docs, styled gallery cards (the looks shown on the docs site, each with a summary of what it changes and light/dark screenshots) and the landing preview. Start with `view: "index"` to see every look on one page, then fetch the chosen card by its slug.
| Parameter | Type | Description |
|---|---|---|
tag * | string | Component tag, id or package: `c2-button`, `button`, `@c2n/button`, `c2-tab`, or a concrete icon tag such as `c2-feather-arrow-right` |
format | string | Output format |
kind | string | Only this kind |
label | string | Substring filter on the example label, or a gallery slug from the index |
limit | integer | |
offset | integer | |
query | string | Search label, section, description, use case, accessibility note and component tags |
section | string | Gallery section filter (e.g. "Variants", "Sizes") |
view | string | `index`: one line per example (label, slug, summary, screenshot), no code and no paging; `full`: markup and CSS |
search_examples Search gallery looks
Search every component's gallery for a look or a use case ("compact", "glass", "pill", "danger", "underline input", "KPI"): returns matching cards across components with their summary and screenshot. Fetch one with get_examples `label: <slug>`.
| Parameter | Type | Description |
|---|---|---|
query * | string | The look or situation you want |
limit | integer | |
tag | string | Limit to one component |
get_presets Get presets
Curated presets of a component ("inspiration" looks): base markup plus each preset as CSS variable values and attributes.
| Parameter | Type | Description |
|---|---|---|
tag * | string | Component tag, id or package: `c2-button`, `button`, `@c2n/button`, `c2-tab`, or a concrete icon tag such as `c2-feather-arrow-right` |
format | string | Output format |
name | string | Substring filter on the preset name |
get_theme Get theme tokens
The @c2n/theme design tokens (--c2-theme--*) with light/dark defaults, how to install and map your own tokens, and dark mode. With `tag`: which of that component's variables follow which token.
| Parameter | Type | Description |
|---|---|---|
format | string | Output format |
tag | string | Component tag, id or package: `c2-button`, `button`, `@c2n/button`, `c2-tab`, or a concrete icon tag such as `c2-feather-arrow-right` |
generate_variant Generate a variant component
Turns CSS variable / attribute overrides of a component into copy-paste code: a CSS class, HTML + <style>, a Lit subclass registered under your own tag, or JSON. Validates variable and attribute names against the component API. Start from a curated preset with `preset`, or from a gallery card with `example` (its slug or label).
| Parameter | Type | Description |
|---|---|---|
name * | string | Class / tag name of the variant (kebab-case, must contain a hyphen, not c2-*) |
tag * | string | Component tag, id or package: `c2-button`, `button`, `@c2n/button`, `c2-tab`, or a concrete icon tag such as `c2-feather-arrow-right` |
attributes | object | Attributes to fix, e.g. {"running": "true"} |
css | object | Component CSS variables to fix, e.g. {"--c2-button__container--background-color": "var(--c2-theme--color-error)"} |
example | string | Gallery card to start from, by slug or label (get_examples view: index): its themed variables for this component are merged under `css` |
format | string | |
html | string | Base markup; defaults to the example or preset markup, else `<tag>Label</tag>` |
preset | string | Name of a curated preset to start from (its values are merged under `css`) |
validate_markup Validate markup
Checks HTML, JSX, Vue, Svelte, Astro, Angular or Lit markup and CSS you wrote against the installed c2n API: native controls a c2-* element replaces (<button>, <input>, <select>, <textarea>, <dialog>, <details>, <progress>), unknown c2-* tags, attributes, slots, events and --c2-* variables (with "did you mean"), and box styling on a c2-* host. Lists the imports that register the elements used. Call it on every file you write before finishing.
| Parameter | Type | Description |
|---|---|---|
code * | string | The source to check: a component file, a template, a stylesheet or a snippet |
filename | string | File name, which sets how the source is read (`App.tsx`: JSX props; `styles.css`: a stylesheet). Always pass it; without it the source is read as HTML |
format | string | Output format |
report_issue Draft a component issue
Drafts a GitHub issue about c2n met while building an app: a component bug, something documented that does not work, a missing feature or component, an API that made the common case hard, a mismatch between get_component and the behaviour, or a workaround you had to write (plain HTML instead of a c2-* element, a CSS or timing hack). Fills in the installed version and the framework, checks the reproduction with validate_markup, looks for existing issues that name the component (only its tag is sent to GitHub), and returns the draft plus a link that opens the pre-filled issue form. It never subm…
| Parameter | Type | Description |
|---|---|---|
actual * | string | What happened instead |
building * | string | What the developer was building, in a sentence, without private details |
component * | string | The element or package the problem is in: `c2-table`, `table` or `@c2n/table` |
expected * | string | What should have happened |
kind * | string | `bug`: wrong behaviour; `gap`: documented or implied but missing; `feature`: a capability or component c2n does not have; `papercut`: works, but the common case is hard; `docs`: the docs or an MCP ans… |
title * | string | One line naming the problem, e.g. "renderCell node does not fill the cell" |
format | string | Output format |
repro | string | The smallest markup, CSS or script that shows it (checked with validate_markup) |
reproFilename | string | File name that sets how the reproduction is read (`repro.tsx`, `repro.css`); HTML by default |
searchExisting | boolean | Search GitHub for existing issues that name this component (sends only the component's tag; needs network access) |
workaround | string | What was done instead, if anything |
get_workflow_guide Get workflow guide
The c2n application workflow guides: `workflow` (theme once, use tags, name what repeats), `theming`, `variant-components`, `frameworks` (plain HTML, Lit, Astro, React, Vue, SSR).
| Parameter | Type | Description |
|---|---|---|
topic | string |