templUI Pro coming soon  

50% OFF Join Waitlist

Code

Code displays a code block with optional syntax highlighting and copy functionality

TailwindCSS

fmt.Println("Hello, World!")

Usage

1. Add the script to your page/layout:

// Option A: All components (recommended)
@util.ComponentScripts()

// Option B: Only Code
@code.Script()

Examples

Copy Button

fmt.Println("Hello, World!")

Custom Size

package main

import (
   "fmt"
   "log"
   "net/http"
)

func main() {
   http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
       fmt.Fprintf(w, "Hello, World!")
   })

   fmt.Println("Server starting on :3000...")
   if err := http.ListenAndServe(":3000", nil); err != nil {
       log.Fatal(err)
   }
}