Default
import { PixelRotate } from '@pxlkit/ui-kit';
export function Default() {
return (
<PixelRotate>
<span>Rotate</span>
</PixelRotate>
);
}Full 360° rotation loop with configurable direction, duration, and trigger.
onComplete (React), @complete (Vue), (complete) (Angular)import { PixelRotate } from '@pxlkit/ui-kit';| Prop | Type | Default | Description |
|---|---|---|---|
children (required) | React.ReactNode | — | Content to rotate. |
duration | number | 1800 | Animation duration in milliseconds. Default 1800. |
repeat | number | 'infinite' | 'infinite' | Iteration count: a number or 'infinite'. Default 'infinite'. |
direction | 'normal' | 'reverse' | 'alternate' | 'alternate-reverse' | 'normal' | CSS animation-direction. Default 'normal'. |
easing | string | 'linear' | CSS animation-timing-function. Default 'linear'. |
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
respects prefers-reduced-motionAnimation is suppressed when the user has requested reduced motion.
import { PixelRotate } from '@pxlkit/ui-kit';
export function Default() {
return (
<PixelRotate>
<span>Rotate</span>
</PixelRotate>
);
}import { PixelRotate } from '@pxlkit/ui-kit';
export function Default() {
return (
<PixelRotate>
<span>Rotate</span>
</PixelRotate>
);
}import { PixelRotate } from '@pxlkit/ui-kit';
export function ReverseDirection() {
return (
<PixelRotate direction="reverse" duration={2400}>
<span>Reverse</span>
</PixelRotate>
);
}import { PixelRotate } from '@pxlkit/ui-kit';
export function HoverTrigger() {
return (
<PixelRotate trigger="hover" repeat={1} duration={900}>
<span>Hover me</span>
</PixelRotate>
);
}