Skip to content

Component ButtonGroup

MeowLynxSea edited this page Jun 18, 2026 · 4 revisions

ButtonGroup

A horizontal or vertical container that visually groups buttons.

use yororen_ui::headless::button::button;
use yororen_ui::headless::button_group::button_group;

button_group("align", cx)
    .attached(true)
    .child(button("left", cx).caption("Left").render(cx))
    .child(button("center", cx).caption("Center").render(cx))
    .child(button("right", cx).caption("Right").render(cx))
    .render(cx)

Props

Method Purpose
vertical() Stack children top-to-bottom (default: horizontal).
attached(v) Visually merge children into a single segmented control.
child(stateful) Append one rendered child (Stateful<Div>).

Children must be passed in already-rendered form — call .render(cx) on each child and pass the result to .child(...).

.render(cx) returns Stateful<Div>.

See also: Button, ToggleButton.

Clone this wiki locally