Showcase: Interactive Dev Components
A demonstration of the advanced interactive components built to solve common dev-blog friction points.
Welcome to the future of developer blogging. We've built 5 advanced interactive components to make your technical content more engaging and useful.
1. Global Variable Sync#
Tired of telling users to "replace YOUR_API_KEY in 5 different places"? Use the Variable Sync system. Enter your values below, and watch them update site-wide!
[!TIP] Your key is: [Enter Key Above]. This value will reactively update in any code block or text using the
<Var />component.
How to use#
To implement reactive variables, wrap your content in the <VariableProvider> (automatically handles this in blog posts) and use these two components:
<VarInput />: Creates the input field.name: The unique ID for the variable.label: Display name above the input.
<Var />: Displays the value anywhere in your text.name: Must match the input ID.fallback: What to show before the user types anything.
<VarInput name="user" label="Username" />Hello, <Var name="user" fallback="Guest" />!2. Project Scaffolder#
The Tree component now generates an instant setup script. Click "Copy Script" and paste it into your terminal to recreate the structure below.
How to use#
The <Tree> component parses indented text into a visual folder structure and a downloadable script.
- Indentation: Use 2 spaces for each level.
- Folders: End the name with a
/(e.g.,src/). - Highlighting: Add an asterisk
*to the end of a filename to highlight it. - Button: The "Copy Script" button automatically appears and generates
mkdir -pandtouchcommands.
<Tree>{\`root/ folder/ file.ts* config.json\`}</Tree>3. Mermaid Architecture Editor#
Static diagrams are a thing of the past. View the architecture below, and if you want to experiment, click Edit to change the logic in real-time.
How to use#
The <MermaidEditor /> component renders diagrams using the Mermaid.js syntax.
code: Pass the mermaid logic inside a template string.- Interaction: Users can toggle between "View" and "Edit" modes.
- Error Handling: If the user writes invalid syntax in Edit mode, a clean error panel appears instead of crashing the site.
<MermaidEditor code={\`graph TD A[Start] --> B[End]\`} />4. Live API Pinger#
Test your endpoints directly from the blog post. This pinger captures the real flow: Handshake -> Transfer -> Response.
How to use#
Use the <ApiPinger /> to document APIs that readers can actually test.
url: The default endpoint to ping.method: Defaults toGET, but supportsPOST,PUT, etc.- Output: Renders a clean JSON preview of the response or a detailed error message if the fetch fails.
<ApiPinger url="https://api.example.com/v1" method="GET" />5. JSON Explorer#
Stop dumping massive JSON payloads into text. The JSON Explorer provides a searchable, collapsible, and high-performance viewer.
How to use#
The <JsonExplorer /> is perfect for deep-diving into complex objects.
data: Pass a standard JavaScript object.title: The text displayed in the header bar.highlight: (Optional) Provide a dot-notation path (e.g.,profile.social.github) to auto-expand and highlight that specific node on load.- Filtering: Includes a built-in search bar for users to find keys/values in large payloads.
<JsonExplorer title="User Profile Response" highlight="profile.social.github" data={{ id: "user_8829", username: "0x1da49", profile: { bio: "Building the next generation of developer tools.", avatar: "https://github.com/0x1da49.png", social: { github: "https://github.com/0x1da49", twitter: "@0x1da49" } }, settings: { theme: "dark", notifications: true } }}/>Conclusion#
These components are designed to reduce cognitive load and make learning more interactive. Enjoy building with the Base Dev boilerplate!