1.0.3 • Published 9 months ago

@mebsly/img-placeholder-generator v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Generate minimal SVG placeholders with customizable text, colors, and dimensions.

import { generateSVGPlaceholder } from "@mebsly/img-placeholder-generator";

export default function App() {
  const base64Image = generateSVGPlaceholder({
    text: "OK",
    width: 120,
    height: 120,
    bgColor: "#E0FFE0",
    textColor: "#006600",
    fontSize: 36,
    fontFamily: "Courier New",
    borderRadius: 12,
    output: "base64",
  });

  return (
    <div className="App">
      <h2>
        Generate minimal SVG placeholders with customizable text, colors, and
        dimensions.
      </h2>
      <img src={base64Image} alt="placeholder" width={120} height={120} />
    </div>
  );
}
const { generateSVGPlaceholder } = require('@mebsly/img-placeholder-generator');

const svg = generateSVGPlaceholder({
  text: "Demo",
  width: 120,
  height: 120,
  bgColor: "#E0FFE0",
  textColor: "#006600",
  fontSize: 36,
  fontFamily: "Courier New",
  borderRadius: 12,
  output: "svg"
});

console.log(svg);
1.0.3

9 months ago