1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

feat(app): introduce button selector component [EE-2004] (#6112)

This commit is contained in:
Chaim Lev-Ari 2021-11-21 11:39:26 +02:00 committed by GitHub
parent 17a20cb2c6
commit 8e83a95996
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 101 additions and 2 deletions

View file

@ -1,17 +1,19 @@
import { PropsWithChildren } from 'react';
import clsx from 'clsx';
type Size = 'xsmall' | 'small' | 'large';
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))} role="group">
<div className={clsx('btn-group', sizeClass(size), className)} role="group">
{children}
</div>
);