finsignal-segment-control
Version:
Segment control and news feed components for React web applications
6 lines (5 loc) • 457 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import './styles.css';
export function SegmentControl({ options, value, onValueChange, className = '' }) {
return (_jsx("div", { className: `segment-control ${className}`, children: options.map((option) => (_jsx("button", { onClick: () => onValueChange(option.value), className: `segment-option ${value === option.value ? 'active' : ''}`, type: "button", children: option.label }, option.value))) }));
}