alanwsmith.com ~ other tools ~ other projects

Alan's SVG Button Maker

This tool converts SVGs into HTML/CSS buttons with the following features:

Instructions

The process for creating a button is:

  1. Open your SVG file in a text editor (e.g. the free Visual Studio Code) then copy and paste the text into the Input -> SVG Input field

    You can also click one of the Input -> Samples to get started

  2. The Input -> Preview shows how the button will look and function. When you click on it, its Clicks counter will update.
  3. Customize your button's colors, classes, and sizes in the Button Customization and Page Customization sections
  4. Copy the Output -> Root CSS Variables and Output -> Button CSS fields to your site's CSS.

    You only need on copy of the Output -> Root CSS Variables in your CSS even if you use multiple Output -> Button CSS snippets to create different buttons

  5. Copy the Output -> Example Listener code to your site's JavaScript (and update it to provide whatever functionality you need for the button)
  6. Copy the Output -> Button HTML to wherever you want a button to appear on your site

Consider staring the project on GitHub if you find it useful:


Input

SVG Input
Samples
Preview
-

Output

Root CSS Variables
Button CSS
Example Listener
Button HTML

Button Customization

CSS Classes
Aria Label
Primary Color
Border Color
Background Color
Preview
-

Page Customizations

Preview
-

TODO
Notes
Issues
References