/Click feedback
Click feedback • CSS
Download for iOS Button
An outlined iOS download button whose arrow reveals without changing its width.
Installation
Requires lucide-react for its icons. The shadcn CLI installs it for you; copying the code by hand means installing it yourself.
Terminal
npx shadcn@latest add https://microkit.co/r/download-ios-button.jsonCode
TypeScript component
1import { ArrowRight } from "lucide-react";23function AppleMark() {4return (5<svg className="download-ios-apple" width="18" height="20" viewBox="0 0 14 16" fill="none" aria-hidden="true">6<path d="M13.5621 5.45739C13.4857 5.50195 11.6671 6.44248 11.6671 8.52785C11.7528 10.9061 13.9621 11.7401 14 11.7401C13.9621 11.7847 13.6665 12.8763 12.7907 14.0205C12.0956 15.0062 11.3242 16 10.1528 16C9.0385 16 8.6385 15.3431 7.35278 15.3431C5.97203 15.3431 5.58135 16 4.5242 16C3.35277 16 2.52419 14.953 1.79127 13.9766C.839096 12.6986.0297778 10.6931.00120634 8.76747C-.0180484 7.74707.19189 6.74403.72481 5.89206C1.47699 4.70265 2.81985 3.89524 4.28631 3.86862C5.40992 3.83331 6.40992 4.58747 7.09563 4.58747C7.75278 4.58747 8.98135 3.86862 10.3714 3.86862C10.9714 3.86919 12.5714 4.03762 13.5621 5.45739ZM7.0006 3.66488C6.8006 2.73303 7.35278 1.80119 7.86706 1.20677C8.52421.487918 9.5621 0 10.4571 0C10.5143.931848 10.1522 1.84575 9.50496 2.51136C8.92421 3.23021 7.92421 3.77138 7.0006 3.66488Z" fill="currentColor" />7</svg>8);9}1011export function DownloadIOSButton() {12return (13<button type="button" className="download-ios-button">14<span className="download-ios-content">15<AppleMark />16<span className="download-ios-label">Download for iOS</span>17<span className="download-ios-arrow" aria-hidden="true">18<ArrowRight size={17} strokeWidth={2.4} />19</span>20</span>21</button>22);23}
CSS
1.download-ios-button {2display: inline-flex;3align-items: center;4justify-content: center;5width: 228px;6min-height: 56px;7overflow: hidden;8border: 1px solid #ffffff14;9border-radius: 12px;10background: transparent;11padding: 8px 16px;12color: #f0f0f0;13}14.download-ios-content {15position: relative;16display: inline-flex;17align-items: center;18gap: 8px;19}20.download-ios-apple {21width: 24px;22height: 24px;23flex: none;24color: #f0f0f0;25transition: width .52s cubic-bezier(.16, 1, .3, 1), margin .52s cubic-bezier(.16, 1, .3, 1), opacity .24s ease, transform .52s cubic-bezier(.16, 1, .3, 1);26}27.download-ios-label {28position: relative;29z-index: 1;30white-space: nowrap;31font-size: 16px;32font-weight: 500;33}34.download-ios-arrow {35display: grid;36width: 0;37height: 24px;38margin-left: -8px;39overflow: hidden;40place-items: center;41opacity: 0;42transform: translateX(18px);43transition: width .52s cubic-bezier(.16, 1, .3, 1), margin .52s cubic-bezier(.16, 1, .3, 1), opacity .24s ease, transform .52s cubic-bezier(.16, 1, .3, 1);44}45.download-ios-button:hover .download-ios-apple,46.download-ios-button:focus-visible .download-ios-apple {47width: 0;48margin-right: -8px;49opacity: 0;50transform: translateX(-18px);51}52.download-ios-button:hover .download-ios-arrow,53.download-ios-button:focus-visible .download-ios-arrow {54width: 24px;55margin-left: 0;56opacity: 1;57transform: translateX(0);58}59.download-ios-button:focus-visible {60outline: 2px solid #f97316;61outline-offset: 3px;62}