본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

리플

원문 보기 위키 갱신

리플 (Ripple)

리플 디렉티브는 호스트 엘리먼트에 물결이 퍼지는 듯한 시각 효과를 추가해줘요. 엘리먼트에 pRipple만 붙이면 되는데, 데모에서 결과를 확인하려면 테마 컨피규레이터에서 리플 옵션을 먼저 켜야 해요. 리플 엘리먼트에는 aria-hidden이 적용되어 스크린 리더가 무시하도록 처리되어 있고, dt나 pt 같은 프롭으로 디자인 토큰과 passthrough 옵션도 설정할 수 있어요

출처: 문서

본문

접근성

Screen Reader 리플 엘리먼트는 aria-hidden 속성이 true로 설정되어 있어서 스크린 리더가 이를 무시해요. Keyboard Support 컴포넌트에는 인터랙티브 요소가 포함되어 있지 않아요.

커스텀

스타일링 데모 콘텐츠예요.

import { Component } from '@angular/core';
import { RippleModule } from 'primeng/ripple';

@Component({
    template: `
        <div class="card flex flex-col gap-4 items-center">
            <span
                >Ripple option at the
                <span class="mx-1 h-8 w-8 rounded-border inline-flex items-center justify-center bg-primary text-primary-contrast"><i class="pi pi-palette"></i></span>
                configurator needs to be turned on for the demo.</span
            >
            <div class="flex justify-center gap-2">
                <div pRipple class="box" style="border: 1px solid rgba(75, 175, 80, 0.3); --p-ripple-background: rgba(75, 175, 80, 0.3)">Green</div>
                <div pRipple class="box" style="border: 1px solid rgba(255, 193, 6, 0.3); --p-ripple-background: rgba(255, 193, 6, 0.3)">Orange</div>
                <div pRipple class="box" style="border: 1px solid rgba(156, 39, 176, 0.3); --p-ripple-background: rgba(156, 39, 176, 0.3)">Purple</div>
            </div>
        </div>
    `,
    standalone: true,
    imports: [RippleModule]
})
export class RippleCustomDemo {}

기본

기본 데모 콘텐츠예요.

import { Component } from '@angular/core';
import { RippleModule } from 'primeng/ripple';

@Component({
    template: `
        <div class="card flex flex-col items-center gap-4">
            <span
                >Ripple option at the
                <span class="mx-1 h-8 w-8 rounded-border inline-flex items-center justify-center bg-primary text-primary-contrast"><i class="pi pi-palette"></i></span>
                configurator needs to be turned on for the demo.</span
            >
            <div pRipple class="ripple-box">Default</div>
        </div>
    `,
    standalone: true,
    imports: [RippleModule]
})
export class RippleDefaultDemo {}

Ripple

Ripple 디렉티브는 호스트 엘리먼트에 리플 효과를 추가해요.

프로퍼티

이름 타입 기본값 설명
dt InputSignal undefined 컴포넌트의 스코프 디자인 토큰을 정의해요.
unstyled InputSignal undefined 컴포넌트를 스타일 없이 렌더링할지 여부를 나타내요.
pt InputSignal undefined 컴포넌트 내부의 DOM 엘리먼트에 속성을 전달하는 데 사용해요.
ptOptions InputSignal undefined 컴포넌트의 passthrough(pt) 옵션을 구성하는 데 사용해요.

테밍

CSS 클래스

클래스 설명
p-ink 루트 엘리먼트의 클래스 이름이에요

디자인 토큰

토큰 CSS 변수 설명
ripple.background --p-ripple-background 루트의 배경이에요

더 알아보기 (Learn more)

이 문서에는 원문에서 추출한 별도의 관련 문서 링크가 없어요.