BrutalButton

A NeoBrutalism style button with sharp shadows and stark borders.

Preview

Loading GPUI

Props

Custom Variant

You can easily override the default colors to create your own flavor of neobrutalism.

Loading GPUI
BrutalButton::new("brutal", "Brutal Doom")
    .color(rgb(0xa3e635))
    .text_color(rgb(0x000000))
    .radius(12.0)

Install

cargo add evilbuttons

Usage

use evilbuttons::BrutalButton;
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(BrutalButton::new("launch", "Launch"))
    }
}

Props

MethodTypeDefaultDescription
new(id, label)impl Into<ElementId>, impl Into<SharedString>-Unique id and the button label.
color(c)impl Into<Hsla>#ffffffBackground color of the button.
text_color(c)impl Into<Hsla>#0a0a0aText color of the button.
border(c)Option<Hsla>Some(#0a0a0a)Color of the 2px border; None removes it.
shadow(c)Option<Hsla>Some(#0a0a0a)Color of the sharp shadow; None removes it and the press squashes instead.
radius(px)f320.0Corner radius.
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.

Search docs

Jump to a button documentation page