UNPKG

@jk-core/components

Version:
29 lines (28 loc) 1.36 kB
import { ReactNode } from 'react'; interface Props extends React.ButtonHTMLAttributes<HTMLButtonElement> { /** 버튼 내용 */ children: ReactNode; /** 버튼 등급 (Primary, Secondary, Tertiary, Cancel) */ grade?: 'tertiary' | 'secondary' | 'primary' | 'cancel'; /** 버튼 비활성화 여부 */ disabled?: boolean; /** 버튼 클래스 */ className?: string; /** 로딩 중 여부, 버튼 내부 스피너 표시 */ isLoading?: boolean; /** 버튼 클릭 이벤트 핸들러 */ onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void; } /** * 공용 버튼 컴포넌트입니다. * * 다양한 등급(grade)과 상태(로딩, 비활성화 등)를 지원하며, 텍스트와 클릭 이벤트를 전달할 수 있습니다. * * - `grade` prop을 통해 버튼의 스타일(Primary, Secondary, Tertiary, Cancel)을 지정할 수 있습니다. * - `isLoading`이 true일 때 로딩 애니메이션이 표시됩니다. * - `disabled`가 true이면 버튼이 비활성화됩니다. * - `text` prop으로 버튼에 표시할 텍스트를 지정합니다. * - 추가적으로 button의 모든 기본 속성(React.)을 지원합니다. */ export default function Button({ children, grade, disabled, onClick, className, isLoading, ...props }: Props): import("react/jsx-runtime").JSX.Element; export {};