import React from "react"; import { cls } from "../util"; export type ToggleButtonOption = { value: T; label: string; icon?: React.ReactNode; disabled?: boolean; } export type ToggleButtonGroupProps = { /** * Currently selected value */ value: T; /** * Callback when value changes */ onValueChange: (value: T) => void; /** * Options to display */ options: ToggleButtonOption[]; /** * Additional class names for the container */ className?: string; } /** * A toggle button group component for selecting one option from a set. * Displays options as buttons in a horizontal row with active state styling. */ export function ToggleButtonGroup({ value, onValueChange, options, className }: ToggleButtonGroupProps) { return (
{options.map((option) => ( ))}
); }