Secondary Action Button Template

This template provides a subtle yet clear button for alternative user actions.

It is designed to complement a primary button without competing for attention, making it perfect for options like viewing details or canceling a process.

Screenshot of a subtle, secondary action button, often using an outline style.

Get Source Code Preview

About the Secondary Action Button

A secondary action button, often styled as an "outline" or "ghost" button, represents a secondary choice for the user. While the primary button is bold and draws the eye, the secondary button has a lower visual weight. It gives users an alternative path without distracting them from the main goal.

Features

Code Breakdown

The CSS for this component uses a transparent background-color and a solid border for its default state. When a user hovers or focuses on the button, a transition smoothly animates the background fill and changes the text color to maintain contrast. The :focus-visible pseudo-class applies a high-contrast outline around the button, ensuring it stands out for keyboard navigation.

Code

Here is the self-contained code for the secondary action button template.

View Output