MinimalButton

A quiet dark button with a hairline ring, inner highlight, soft drop shadow, and a chevron that nudges on hover.

Preview

Loading GPUI

Props

Install

cargo add evilbuttons

Usage

use evilbuttons::MinimalButton;
use gpui::{div, prelude::*, Context, IntoElement, Render, Window};

struct ButtonDemo;

impl Render for ButtonDemo {
    fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {
        div().child(MinimalButton::new("browse", "Browse components"))
    }
}

Variants

No arrow

Loading GPUI
MinimalButton::new("save", "Save draft").arrow(false)

Props

MinimalButton is a GPUI RenderOnce builder; its animation state is keyed by id.

MethodTypeDefaultDescription
new(id, label)impl Into<ElementId>, impl Into<SharedString>-Unique id and the button label.
arrow(bool)booltrueShow a trailing chevron that nudges forward on hover.
on_click(f)Fn(&ClickEvent, &mut Window, &mut App)-Fired on click, and on Space/Enter while focused.
disabled(bool)boolfalseDims the button and ignores input.

Good to know

  • GPUI has no CSS transforms, so the 97% press is painted: the surface and its shadows shrink around their centre.
  • Stays dark in both themes.

Search docs

Jump to a button documentation page