Files
material-you-react/src/primitive-components/button-components/segmented-buttons/segmented-buttons.tsx
doryan04 df1d0c2599 CHANGED: style and components directories, removed redundant imports from styles
ADDED: container and card component, card-subcomponents WIP
2025-04-03 11:30:03 +04:00

20 lines
538 B
TypeScript

import React, { forwardRef } from 'react';
import { SegmentedButtonProps } from './segmented-buttons.types';
export const SegmentedButtons = forwardRef<
HTMLDivElement,
SegmentedButtonProps
>(({ children, ...props }, ref) => {
if (children.length <= 1) {
throw 'You must build segmented button with 2 or more buttton';
}
return (
<div
className={`m3 m3-segmented-buttons ${props.className ?? ''}`.trimEnd()}
ref={ref}
>
{children}
</div>
);
});