Code Snippet Deck

An interactive multi-runtime developer code snippet deck with runtime switching (cURL, TypeScript, Python, Go, Rust), live dynamic parameter customizations, and line highlighting.

client.ts
1import { EasyClient } from "@easyui/sdk";
2
3// Initialize resilient client
4const client = new EasyClient({
5 apiKey: "sk_live_9981",
6 environment: "production",
7 streaming: true,
8});
9
10// Stream AI generation with zero layout shift
11const completion = await client.completions.create({
12 model: "easy-4o",
13 prompt: "Synthesize dark UI telemetry dashboard",
14});
Runtime: TypeScript14 lines

Installation

Add the component directly to your repository using shadcn CLI:

npx shadcn@latest add Surajmaurya1/easyui/code-snippet-deck

API Reference

PropTypeDefaultDescription
snippetsSnippetItem[][]Collection of language snippets and generator functions
parametersSnippetParameter[][]Configurable runtime variables (checkboxes, dropdowns, inputs)
defaultLanguagestringsnippets[0]?.languageInitially selected language key
showLineNumbersbooleantrueWhether to display code line numbering
showWindowBarbooleantrueWhether to render macOS window bar header
classNamestringundefinedCustom CSS container classes