# Discover Button

> Pill button whose dark fill sweeps across on hover while the arrow slides forward.

- Kind: Element
- Page: https://ownlyplans.com/bhaskar/discover-button/
- Licence: MIT (do anything, keep the notice)

## Code

`index.html`

```html
<!--
  Ported to plain HTML/CSS/JS for OwnlyPlans from ObsidianUI (https://github.com/Atharvsinh-codez/ObsidianUI)
  MIT License — Copyright (c) 2026 ObsidianUI
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
  documentation files (the "Software"), to deal in the Software without restriction, including without limitation
  the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
  permit persons to whom the Software is furnished to do so, subject to the following conditions:
  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.
-->
<div class="op-demo-stage">
  <a class="op-discover-button" href="#">
    <span class="op-discover-button__fill" aria-hidden="true"></span>
    <span class="op-discover-button__icon" aria-hidden="true">
      <svg width="25" height="25" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg>
    </span>
    <span class="op-discover-button__text">Discover Components</span>
  </a>
</div>
```

`styles.css`

```css
/* Ported from ObsidianUI (MIT License, Copyright (c) 2026 ObsidianUI) */
.op-demo-stage{min-height:320px;display:grid;place-items:center;background:#0a0a0a;font-family:Inter,system-ui,sans-serif}
.op-discover-button{position:relative;display:inline-flex;min-height:66px;max-width:100%;align-items:center;overflow:hidden;border:1px solid rgb(255 255 255 / 30%);border-radius:999px;background:var(--op-discover-surface,rgb(237 237 237 / 92%));backdrop-filter:blur(10px);color:var(--op-discover-text,#171717);cursor:pointer;font-family:inherit;font-size:1rem;font-weight:600;line-height:1.1;text-decoration:none;white-space:nowrap;animation:op-discover-enter 500ms cubic-bezier(.22,1,.36,1) both}
.op-discover-button__fill{position:absolute;inset:2px auto 2px 2px;width:60px;border-radius:inherit;background:var(--op-discover-fill,#171717);box-shadow:inset 0 0 0 1px rgb(255 255 255 / 12%);transition:width 480ms cubic-bezier(.65,0,.076,1)}
.op-discover-button__icon{position:relative;z-index:1;display:grid;width:64px;height:64px;flex:none;place-items:center;color:var(--op-discover-active-text,#fff);transition:transform 480ms cubic-bezier(.65,0,.076,1)}
.op-discover-button__text{position:relative;z-index:1;padding:0 27px 0 15px;text-align:center;transition:color 320ms ease}
.op-discover-button:hover .op-discover-button__fill,.op-discover-button:focus-visible .op-discover-button__fill{width:calc(100% - 4px)}
.op-discover-button:hover .op-discover-button__icon,.op-discover-button:focus-visible .op-discover-button__icon{transform:translateX(7px)}
.op-discover-button:hover .op-discover-button__text,.op-discover-button:focus-visible .op-discover-button__text{color:var(--op-discover-active-text,#fff)}
.op-discover-button:focus-visible{outline:2px solid #a3a3a3;outline-offset:4px}
@keyframes op-discover-enter{from{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}
@media (prefers-reduced-motion:reduce){.op-discover-button{animation:none}.op-discover-button__fill,.op-discover-button__icon,.op-discover-button__text{transition:none}}
```

## About

Pill button whose dark fill sweeps across on hover while the arrow slides forward. Ported to plain HTML, CSS and JavaScript from ObsidianUI (github.com/Atharvsinh-codez/ObsidianUI), which is released under the MIT License. The original copyright notice is kept in the code.

---
Also available as JSON: https://ownlyplans.com/bhaskar/discover-button/?format=json
MCP server: https://ownlyplans.com/mcp
