npx astro add moonarcpnpm astro add moonarcbunx astro add moonarcA code block with tabs (for example npm, pnpm, bun) and a copy button per panel.
A feature section with code beside the copy: a headline, copy and a short list on one side, and CodeTabs on the other, one tab per client or language, each panel with its own copy button. The code keeps a ground it reads on in every tone, and the section sets CodeTabs through its tokens. The section ships no script of its own; CopyButton's script is the shared chunk.
Add the MCP server once and the agent searches components by intent and byte budget, reads their craft notes and gets the command that installs them.
# in your project
claude mcp add moonarc -- npx -y @moonarc/mcp// .cursor/mcp.json
{
"mcpServers": {
"moonarc": { "command": "npx", "args": ["-y", "@moonarc/mcp"] }
}
}// .vscode/mcp.json
{
"servers": {
"moonarc": { "type": "stdio", "command": "npx", "args": ["-y", "@moonarc/mcp"] }
}
}# ~/.codex/config.toml
[mcp_servers.moonarc]
command = "npx"
args = ["-y", "@moonarc/mcp"]Live, from the library itself, at full size: scroll, hover, navigate away and back. The demo is never gated.
Variants · each row writes the attribute the prop writes; the section's own CSS answers
JavaScript of its own
0 B
Uses CopyButton and the shared runtime (1.9 kB raw, once per site). With those included: 2.5 kB raw.
CSS 18.6 kB raw including the base tokens. Measured from a production build, and again in CI for every change that can move it.
Browser support
Chrome 105 · Firefox 121 · Safari 15.4; needs has, clipboard. Elsewhere: the tabs switch without the fade; below 58 rem of the section's width the code follows the text.
The demo above is never gated; the source is. With a key in components.json (see account), the registry serves it like any other item:
npx shadcn@latest add @moonarc-pro/feature-code---
import FeatureCode from '@/components/moonarc/pro/FeatureCode.astro';
---
<FeatureCode
headline="Connect your agent in one command"
copy="The server gives your coding agent read access to builds and a tool to open a pull request."
points={['Read-only tokens by default', 'Every call is in the audit log', 'Works with any client that speaks MCP']}
label="Client"
tabs={[
{ label: 'Terminal', code: 'npx your-cli connect' },
{ label: 'JSON', lang: 'json', code: '{\n "mcpServers": {\n "your-server": { "url": "https://mcp.example.com/mcp" }\n }\n}' },
]}
/>Without a key the registry answers 401 with an upgrade message. Everything this section composes is free: code-tabs.
| Prop | Type | Default | Description |
|---|---|---|---|
tabs | { label: string; code: string; lang?: string }[] | none | The code, up to eight tabs. lang is a Shiki language id, sh by default. Each panel has its own copy button. |
headline | string | none | The headline. The headline slot wins over it. |
eyebrow | string | none | Small label above the headline. The eyebrow slot wins over it. |
copy | string | none | The paragraph under the headline. The copy slot wins over it. |
points | string[] | none | A short list under the copy, one line each, with a tick before it. |
label | string | 'Client' | Accessible name of the tabs, which are a radiogroup. |
active | number | 0 | The tab open on load, from 0. |
themes | { light: string; dark: string } | github-light / github-dark-default | Shiki themes. Every token colour is moved at build until it reads at 4.5 : 1 on its panel. |
side | 'start' | 'end' | 'end' | Side of the code from 58 rem of the section's width: the inline end or the inline start. Below it the code follows the text. |
level | 1 | 2 | 2 | Heading level of the headline: 2 under the page's h1, 1 when the section opens the page. |
tone | 'surface' | 'muted' | 'ink' | 'brand' | unset (paints nothing) | The ground: the page surface, a muted band, an always-dark ink panel, or a deep brand panel. The code block keeps a ground its highlighting reads on: the card on the page, a deep shade on ink and brand (with the dark Shiki theme), the deepest neutral under muted in the dark scheme. |
density | 'compact' | 'cozy' | 'roomy' | 'cozy' | Block padding and the gap between the columns ×0.8 / ×1 / ×1.25 through --ma-density. |
The section reads the theme contract (shadcn's variable names with the base tokens as fallback), so a pasted theme or one --ma-brand recolours it. Its class names are the override surface and stay stable; a named slot replaces the matching prop with your own markup.
.ma-feature-code.ma-feature-code__actions.ma-feature-code__aside.ma-feature-code__code.ma-feature-code__copy.ma-feature-code__eyebrow.ma-feature-code__headline.ma-feature-code__inner.ma-feature-code__points.ma-feature-code__text.ma-feature-code__tick
slot="eyebrow"slot="headline"slot="copy"slot="actions"slot="aside"
The tabs switch in place without the fade and the indicator jumps; nothing of the section moves.
ClientRouterInherits CodeTabs; CopyButton rebinds through the shared runtime.
Replaces: Code block feature section (Tailwind Plus) · Terminal feature (Magic UI). See the migration table.
npx astro add moonarcpnpm astro add moonarcbunx astro add moonarcA code block with tabs (for example npm, pnpm, bun) and a copy button per panel.
npx astro add moonarcA button that copies text to the clipboard: the icon turns into a check, the label says "Copied", and both come back after the ambient duration.
Shows features in alternating rows of copy and a visual.
Also: view transitions · how costs are measured · browser support · accessibility policy · five-minute setup · MCP for agents · this page as Markdown