UnstyledButton

UnstyledButton

스타일이 없는 상태로 렌더링되는 button 요소예요. 커스텀 버튼을 만들 때 기본적인 button 동작(클릭, 접근성)은 유지하면서 스타일을 완전히 제어하고 싶을 때 사용해요.

출처: 문서

본문

래핑한 후에도 컴포넌트를 다형성(polymorphic)으로 유지하고 싶다면, 이 가이드에 설명된 polymorphic 함수를 사용해요.

요소 ref 가져오기 (Get element ref)

import { useRef } from 'react';
import { UnstyledButton } from '@mantine/core';

function Demo() {
  const ref = useRef<HTMLButtonElement>(null);
  return <UnstyledButton ref={ref}>Button</UnstyledButton>;
}

더 알아보기 (Learn more)