Pads and LED buttons

ui.audio.Pad(text="KICK", color="#ff9f3d", on_press=lambda e: engine.node("drums").trigger(), on_release=lambda e: None)pressfires when the pad is pressed, with a velocity from 1 to 127 inevent.value(like MIDI): the lower on the pad you click, the harder the hit.velocity=Falsealways sends 100.releasefires when the button is released or the pointer leaves the pad.lit=Truelights it from outside: a sequencer’s current step, a note coming from a keyboard. The pad glows in itscolor, so a grid of them shows the rhythm at a glance.
| Property | Default | What it does |
|---|---|---|
text |
"" |
The label in the middle. |
color |
"accent" |
The color it lights up in. |
lit |
False |
Lit from outside. |
velocity |
True |
Velocity from where it is pressed. |
width, height |
72, 72 |
Size in pixels. |
LED button
Section titled “LED button”ui.audio.LedButton(text="MUTE", on=self.muted, color="warning", on_toggle=lambda e: setattr(self, "muted", e.value))A dark key with a small light. It toggles on each click (toggle gives True or False),
or with momentary=True it lights only while held (press / release), like a tap-tempo key.
| Property | Default | What it does |
|---|---|---|
text |
"" |
The label. |
on |
False |
Whether it is lit. |
color |
"success" |
The light’s color (a theme token or hex). |
variant |
"fl" |
"fl" (square key), "round" (bigger LED, round key) or "pill". |
momentary |
False |
Lit only while held. |
icon_name |
"" |
A Lucide icon next to the label ("play", "circle"…). |
Events: on_toggle, on_press, on_release.