Skip to content

tscircuit/create-snippet-url

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@tscircuit/create-snippet-url

Open tscircuit code on snippets (snippets URL creator)

Installation

bun add @tscircuit/create-snippet-url

Usage

Basic Usage

import { createSnippetUrl } from "@tscircuit/create-snippet-url"

// Create a board with a resistor
const url = createSnippetUrl(`
export default () => (
  <board width="10mm" height="10mm">
    <resistor
      resistance="1k"
      footprint="0402"
      name="R1"
      schX={3}
      pcbX={3}
    />
  </board>
)
`)

SVG URLs

import { createSvgUrl } from "@tscircuit/create-snippet-url"

// Create a URL to view the PCB SVG
const svgUrl = createSvgUrl(
  `
export default () => (
  <board width="10mm" height="10mm">
    <resistor resistance="1k" footprint="0402" name="R1" schX={3} pcbX={3} />
  </board>
)
`,
  "pcb" // or "schematic" for schematic view
)

// Returns URL pointing to https://svg.tscircuit.com

About

Open tscircuit code on snippets (snippets url creator)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •