You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/react/components/buttons/ButtonGroup.tsx

34 lines
656 B

import { PropsWithChildren } from 'react';
import clsx from 'clsx';
export type Size = 'xsmall' | 'small' | 'large';
export interface Props {
size?: Size;
className?: string;
}
export function ButtonGroup({
size = 'small',
children,
className,
}: PropsWithChildren<Props>) {
return (
<div className={clsx('btn-group', sizeClass(size), className)} role="group">
{children}
</div>
);
}
function sizeClass(size: Size | undefined) {
switch (size) {
case 'small':
return 'btn-group-sm';
case 'xsmall':
return 'btn-group-xs';
case 'large':
return 'btn-group-lg';
default:
return '';
}
}