Send control
Send, stop, queue and steer in one control, in twelve styles: a progress ring, a queue pill, a split, a steer slide, a status tab, pause and stop, a glyph, voice confirm, an answer card, retry and minimal.
oxyn add send-controllet mut send = use_signal(|| SendControl::new(SendVariant::RingProgress));
let view = send.write().view(state, BusyAction::Queue, elapsed, budget, clock.now());
rsx! {
SendButton {
view: view,
variant: "ring-progress",
on_action: move |a: SendAction| agent.handle(a) // send, stop, queue, steer…,
}
}Rendered from Rust at build time · goes live when visible
When to use
- Send, stop, queue and steer in one control, in twelve styles: a progress ring, a queue pill, a split, a steer slide, a status tab, pause and stop, a glyph, voice confirm, an answer card, retry and minimal.
When not to use
- Prompt composer with model picker, voice input, app connections and approval request: use Chat Composer instead.
- The model menu of an AI chat: use Model Picker instead.
- The prompt box for an agent, in six layouts: use Composer instead.
Installation
Send control is free and MIT. The oxyn CLI copies its code, and the components it needs, into src/oxyn/ of your Dioxus or GPUI project, so it is yours to change.
cargo install --git https://github.com/ismailqureshi72/Oxyn oxyn-cli
oxyn init
oxyn add send-controluse crate::oxyn::{SendButton, COMPOSER_CSS};Rather depend on the crate? cargo add oxyn-dioxus oxyn-core --git https://github.com/ismailqureshi72/Oxyn, then use oxyn_dioxus::{SendButton, COMPOSER_CSS};
Usage
let mut send = use_signal(|| SendControl::new(SendVariant::RingProgress));
let view = send.write().view(state, BusyAction::Queue, elapsed, budget, clock.now());
rsx! {
SendButton {
view: view,
variant: "ring-progress",
on_action: move |a: SendAction| agent.handle(a) // send, stop, queue, steer…,
}
}Examples
Ring progress
Stop square with a progress ring.
Code
let mut send = use_signal(|| SendControl::new(SendVariant::RingProgress));
let view = send.write().view(state, BusyAction::Queue, elapsed, budget, clock.now());
rsx! {
SendButton {
view: view,
variant: "ring-progress",
on_action: move |a: SendAction| agent.handle(a) // send, stop, queue, steer…,
}
}Classic
Arrow, then stop.
Code
let mut send = use_signal(|| SendControl::new(SendVariant::RingProgress));
let view = send.write().view(state, BusyAction::Queue, elapsed, budget, clock.now());
rsx! {
SendButton {
view: view,
variant: "classic",
on_action: move |a: SendAction| agent.handle(a) // send, stop, queue, steer…,
}
}Queue pill
Queue while it works.
Code
let mut send = use_signal(|| SendControl::new(SendVariant::RingProgress));
let view = send.write().view(state, BusyAction::Queue, elapsed, budget, clock.now());
rsx! {
SendButton {
view: view,
variant: "queue-pill",
on_action: move |a: SendAction| agent.handle(a) // send, stop, queue, steer…,
}
}Split
Send and steer side by side.
Code
let mut send = use_signal(|| SendControl::new(SendVariant::RingProgress));
let view = send.write().view(state, BusyAction::Queue, elapsed, budget, clock.now());
rsx! {
SendButton {
view: view,
variant: "split",
on_action: move |a: SendAction| agent.handle(a) // send, stop, queue, steer…,
}
}Pause stop
Pause or stop.
Code
let mut send = use_signal(|| SendControl::new(SendVariant::RingProgress));
let view = send.write().view(state, BusyAction::Queue, elapsed, budget, clock.now());
rsx! {
SendButton {
view: view,
variant: "pause-stop",
on_action: move |a: SendAction| agent.handle(a) // send, stop, queue, steer…,
}
}Retry
Retry after a failed send.
Code
let mut send = use_signal(|| SendControl::new(SendVariant::RingProgress));
let view = send.write().view(state, BusyAction::Queue, elapsed, budget, clock.now());
rsx! {
SendButton {
view: view,
variant: "retry",
on_action: move |a: SendAction| agent.handle(a) // send, stop, queue, steer…,
}
}API reference
SendButton
| Prop | Type | Default | Description |
|---|---|---|---|
viewrequired | SendView | — | Frame from `SendControl::view`. |
variant | String | "classic" | Variant id (`classic`, `queue-pill`, `split`, …). |
on_action | EventHandler<SendAction> | — | A segment was pressed. |
on_hold | EventHandler<bool> | — | Pointer down / up on stop (hold-to-stop). |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| Enter | Send, or queue while the agent works (in the composer) |
| ShiftEnter | New line |
| Esc | Stop (with stop_confirm: press twice) |
Accessibility
- Its name follows the state: "Send message", "Stop generating", "Queue message", "Retry sending".
- "Message sent", "Message queued" and "Generation stopped" are announced politely; errors assertively.
From the spec
- Labels per state: Empty "Send message (type a message first)"; Ready "Send message"; Sending/Working "Stop generating"; WorkingWithDraft "Queue message" (and "Steer now" on the steer button); Answering "Submit answer"; Dictating "Insert dictated text"; Disabled "Send unavailable: <reason>"; Error "Retry sending".
- Live region (polite): "Message sent", "Message queued, 2 in queue", "Steering the agent", "Generation stopped". Errors are assertive: "Message failed to send. Retry available".
- Keyboard: all actions reachable without a pointer (Enter, Shift+Enter, ⌘/Ctrl+Enter, Esc, ↑); the footer hint ("Enter to queue", [R089]) is also in the button's description.
- Contrast: the muted
Empty↑ still meets 3:1 (non-text contrast); accent and danger glyphs meet 3:1 against the button fill and the fill meets 3:1 against the composer. - Focus order: input → tools / pickers → mic → send control (→ steer button when present). Focus stays on the input after send; after Stop focus moves back to the input.
- Reduced motion: see the timing table; state is always also carried by the glyph and label.
Motion & interaction
- Hover / press.
Ready: hover lifts the button 1 px with a slightly stronger shadow; press scales 0.94 for 80 ms.Emptyhas no hover lift [R044]. 32 px hit area on desktop, 44 px on touch. - Focus ring. 2 px accent ring, 2 px offset, follows the morphing shape (circle → pill) rather than a fixed square.
- First keystroke. Muted ↑ lights up: colour + scale 0.92 → 1 [R044].
- Send. The draft text flies up and becomes the bubble in one commit (≤ 260 ms, ease-in) [R079]; the button swaps to ■ instantly, no spinner [R086].
- Queue pill. Typing while busy widens ■ into a labelled "Queue" pill [R087]; the chip it creates unfolds upward above the composer [R079] (see composer-queue-stack.md).
- Steer slide. A steer-send button blur-slides in beside ■ once there is a draft [R086].
- Busy-choice shake. With
busy_action = Ask, Enter shakes Steer / Queue / Stop to force a choice [R085]. - Stop. ■ press → the status line drops into the transcript as "Interrupted" [R079] (owned by composer-status-strip.md); the button morphs ■ → ↑ (or ↑ muted if empty).
- Done. ■ → ↑ morph; no celebration on the button by default (Pro
shockwave-doneadds one). - Error. ⟲ in danger tone + 2-cycle shake + inline "Couldn't send · Retry".
- Dictation. ↑ → ✓ while the voice strip is open [R021] (see composer-voice-input.md).
Timing
| Transition | Duration | Easing |
|---|---|---|
| Empty → Ready (colour + scale 0.92 → 1) | 120 ms | ease-out |
| Ready → Sending (glyph morph ↑ → ■) | 160 ms | spring (critically damped) |
| Draft → bubble fly-up | ≤ 260 ms | ease-in |
| ■ → Queue pill widen | 180 ms | spring |
| Queued chip unfold upward | 200 ms + 40 ms stagger (cap 4) | ease-out |
| Steer button blur-slide in | 160 ms | ease-out |
| Error shake | 300 ms, 2 cycles, 6 px | linear |
| Reduced motion | all of the above become 0–80 ms opacity crossfades | — |
Responsive behaviour
- Round styles fit any composer; status-tab, split and queue-pill need more width.
Edge cases (spec)
- Long text / huge pastes. The button never grows with the draft; it stays bottom-trailing as the input grows upward. A paste over the app's size limit puts the button in
Disabled("Message too long")with a count, rather than failing on send. - Draft that is only whitespace or only attachments. Whitespace =
Empty. Attachments without text =Ready(sending files alone is valid) unless an attachment is still uploading, in which caseDisabled("Waiting for upload")with the attachment ring as the progress cue [R036]. - Very fast agent. If the first event and
Doneboth arrive within one frame ofSending, skip the ■ entirely (no flash of stop). - Very slow agent. ■ stays; the optional ring shows elapsed; stall colour belongs to the status strip, not the button.
- Double-submit. Enter pressed twice within 300 ms while
Sendingis ignored, not queued. - IME composition. Enter that commits an IME candidate never sends or queues (check composition state first).
- RTL. The button sits bottom-left; ↑ is direction-neutral; split ↑ ▾ mirrors to ▾ ↑; the queue pill's label grows toward the inline-start.
- Tiny sizes (16–20 px). Glyph only; queue pill collapses to ■ + a 6 px badge dot; split button becomes a long-press menu.
- Dense IDE panels.
send-control/minimaltext labels; hit area stays ≥ 24 px. - Touch. 44 px hit area;
long-press-optionsreplaces the ▾; Stop withStopConfirm::Holduses 400 ms. - Slow networks / offline.
Sendingmay last; the status strip's stall thresholds apply (composer-status-strip.md), and the button stays ■ so the user can cancel. Offline →Disabled("Offline"), but Enter still queues locally if the queue stack is enabled (proposed). - Pending card. While an approval/question card waits, ↑ answers the card [R088]; a normal message is still possible via the queue.
Notes for AI
- Import
SendButtonfromoxyn_dioxusand includeCOMPOSER_CSSplus the token stylesheet once. - A GPUI version exists:
SendButtonElinoxyn_gpui. - Props to set first:
view. - It reads a clock (
now) for live timers; pass one clock for the whole page rather than one per component. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.