You can modify the visual layout and style of the Toggle Group using the following patterns:
Variants
variant="default": Standard transparent background.variant="outline": Adds a border and hover effects.
Sizes
size="default": Standard size.size="sm": Small size with reduced height and text.size="lg": Large size.
Spacing
Use the spacing prop (integer) to adjust the gap between items. The actual gap is calculated as spacing * 0.25rem.
Orientation
orientation="horizontal": Items are laid out in a row.orientation="vertical": Items are laid out in a column.
# Example: Vertical, small, outline variant with custom spacing
toggle_group.root(
toggle_group.item("Top", value="top"),
toggle_group.item("Bottom", value="bottom"),
size="sm",
variant="outline",
orientation="vertical",
spacing=1,
default_value=["top"],
)