0.0.8 • Published 10 months ago

@tscircuit/create-snippet-url v0.0.8

Weekly downloads
-
License
-
Repository
-
Last release
10 months ago

@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
0.0.3

11 months ago

0.0.2

11 months ago

0.0.8

10 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.7

10 months ago

0.0.6

11 months ago

0.0.1

11 months ago