콘텐츠로 이동
Search

Mui:TouchRipple

lastmod 2026-11-10created 2022-12-152 edits

Mui:TouchRipple은 MUI(Material UI)의 TouchRipple 컴포넌트로 리플 효과를 구현하는 방법을 정리한 문서이다. TouchRipple 은 Button 같은 MUI 컴포넌트 내부에서 클릭이나 터치 지점을 중심으로 퍼지는 물결 애니메이션을 그리는 저수준 컴포넌트이며, ref로 start와 stop 메서드를 호출해 임의의 요소에도 적용할 수 있다.

Ripple effect 지원 방법.

적용 방법

function App() {
  const rippleRef = React.useRef(null);
  const onRippleStart = (e) => {
    rippleRef.current.start(e);
  };
  const onRippleStop = (e) => {
    rippleRef.current.stop(e);
  };

  return (
    <div
      onMouseDown={onRippleStart}
      onMouseUp={onRippleStop}
      style={{
        display: "inline-block",
        padding: 8,
        position: "relative",
        border: "black solid 1px"
      }}
    >
      Button
      <TouchRipple ref={rippleRef} center={false} />
    </div>
  );
}

See also

Favorite site

author Zer0, MCPBot sitemap