Default
import { PixelFadeIn } from '@pxlkit/ui-kit';
export function Default() {
return (
<PixelFadeIn>
<div style={{ padding: 16, background: '#111', color: '#fff' }}>
Fades in on mount
</div>
</PixelFadeIn>
);
}Fades children from opacity 0 to 1 with configurable duration, delay, easing, and trigger.
onComplete (React), @complete (Vue), (complete) (Angular)import { PixelFadeIn } from '@pxlkit/ui-kit';| Prop | Type | Default | Description |
|---|---|---|---|
children (required) | React.ReactNode | — | Content to fade in. |
duration | number | 400 | Animation duration in milliseconds. Default 400. |
delay | number | 0 | Animation delay in milliseconds. Default 0. |
repeat | number | 'infinite' | 1 | Iteration count: a number or 'infinite'. Default 1. |
easing | string | 'ease' | CSS animation-timing-function. Default 'ease'. |
fillMode | 'none' | 'forwards' | 'backwards' | 'both' | 'both' | CSS animation-fill-mode. Default 'both'. |
trigger | 'mount' | 'hover' | 'click' | 'focus' | 'inView' | boolean | 'mount' | When the animation should play. Default 'mount'. |
onComplete | () => void | — | Fires after the final iteration. |
className | string | — | Extra class names applied to the wrapping <div>. |
ref points to <div>.
WCAG target: 2.1 AA
prefers-reduced-motionAnimation is suppressed when the user prefers reduced motion.
import { PixelFadeIn } from '@pxlkit/ui-kit';
export function Default() {
return (
<PixelFadeIn>
<div style={{ padding: 16, background: '#111', color: '#fff' }}>
Fades in on mount
</div>
</PixelFadeIn>
);
}import { PixelFadeIn } from '@pxlkit/ui-kit';
export function Default() {
return (
<PixelFadeIn>
<div style={{ padding: 16, background: '#111', color: '#fff' }}>
Fades in on mount
</div>
</PixelFadeIn>
);
}import { PixelFadeIn } from '@pxlkit/ui-kit';
export function Delayed() {
return (
<PixelFadeIn duration={600} delay={200} easing="ease-out">
<div style={{ padding: 16, background: '#0EA5E9', color: '#000' }}>
Delayed fade-in
</div>
</PixelFadeIn>
);
}import { PixelFadeIn } from '@pxlkit/ui-kit';
export function OnHover() {
return (
<PixelFadeIn trigger="hover" duration={300}>
<div style={{ padding: 16, background: '#222', color: '#0EA5E9' }}>
Hover to fade in
</div>
</PixelFadeIn>
);
}