Mohammad Shehadeh

YAML Editor

Forms 2

About

Editable code field with dependency-free YAML syntax highlighting, a line-number gutter and tab-to-indent. Controlled or uncontrolled.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds YAML Editor to your project and fits it to your theme.

Code

How YAML Editor is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { YamlEditor } from "@/components/ui/yaml-editor";

export default function YamlEditorDemo() {
  return (
    <div className="flex w-full max-w-xl items-center justify-center p-8">
      <YamlEditor
        defaultValue={`# deploy/api.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: api
  labels:
    app: api
    tier: backend
spec:
  replicas: 3 # scale with load
  strategy:
    type: RollingUpdate
  template:
    spec:
      containers:
        - name: api
          image: "registry.hirael.com/api:2.4.0"
          ports:
            - containerPort: 8080
          env:
            - name: LOG_LEVEL
              value: info
          readinessProbe:
            httpGet:
              path: /health
              port: 8080
          resources:
            requests:
              cpu: "500m"
              memory: 512Mi
`}
        rows={16}
        className="w-full"
      />
    </div>
  );
}

More by Mohammad Shehadeh

View all
  • Feature Problem Cards

    Feature Problem Cards

    94
  • Ecommerce Category Page

    Ecommerce Category Page

    83
  • Feature Grid Spotlight Cards

    Feature Grid Spotlight Cards

    83
  • Split Login

    Split Login

    76
  • Comparison Section

    Comparison Section

    71
  • FAQ Two Column

    FAQ Two Column

    71
  • Dithered Shader CTA

    Dithered Shader CTA

    70
  • Comparison Table

    Comparison Table

    66

More in Forms

View all
  • Form

    Form

    137
  • Premium Auth

    Premium Auth

    544
  • Contact Card

    Contact Card

    1.1K
  • Login 1

    Login 1

    59
  • Card Studio

    Card Studio

    46
  • Login 2

    Login 2

    10
  • Book A Demo 1

    Book A Demo 1

    81
  • SignInPage

    SignInPage

    713

Explore more

Part of Hirael — browse the full library on 21st.dev.