Download Button Template
This is a clear and intuitive button for offering file downloads on your website.
By pairing an action-oriented label with a familiar download icon, this template makes it obvious to users what will happen when they click.

About the Download Button
A good download button removes any ambiguity for the user. This template achieves this by combining explicit text with a universally recognized download icon. The icon provides a quick visual cue, while the text confirms the action. This component is ideal for any situation where a user needs to download a file, such as a PDF report, a ZIP archive, or an application.
Features
- Iconography Included: Features a clean, inline SVG download icon that requires no external image files or font libraries.
- Perfect Alignment: Uses Flexbox to ensure the icon and text are always vertically centered, regardless of font size.
- Self-Contained & Easy to Use: Simply copy and paste the code block. The embedded SVG means there are no dependencies to manage.
- Accessible: The included SVG uses
aria-hidden="true"
because its purpose is purely decorative; the button's text already describes the action, preventing redundancy for screen reader users.
Code Breakdown
The core of this component is a button
element containing an svg
element and a span
for the text. To align them perfectly, the button is styled with display: inline-flex
and align-items
. The gap
property is used to create consistent spacing between the icon and the text.
The SVG icon's color is set to currentColor
, a special value that makes the icon inherit the color
of its parent element. This means you only need to define the button's text color, and the icon will automatically match it.
Code
Here is the complete code for the download button with an embedded icon.