Skip to content

Component ButtonGroup

MeowLynxSea edited this page Jun 13, 2026 · 4 revisions

ButtonGroup

A horizontal or vertical container that visually groups buttons. Each child is a Stateful<Div> (typically another button(...) element).

Import

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

Minimal example

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 the children top-to-bottom (default: horizontal).
attached(v) Visually merge children into a single segmented control.
child(stateful) Append one rendered child (Stateful<Div>).

Notes

  • Factory takes (id, _cx).
  • Children are passed in already-rendered form (call .render(cx) on the child component first and pass the result to .child(...)).
  • .render(cx) returns Stateful<Div>.

See also

Button, IconButton, ToggleButton, SplitButton

Clone this wiki locally