Skip to content
العربية
Motion

SlashReveal

Media opens with a wipe at the angle of the % slash, in the reading direction. The angle never mirrors.

import { SlashReveal } from "@percentsa/motion";

Examples

Code
export function SlashRevealExample() {
  const t = useT();
  const [key, setKey] = useState(0);
  return (
    <Stack gap={6} className="w-full max-w-md">
      <SlashReveal key={key} aspect={4 / 3} className="rounded-card">
        <div className="grid bg-fg text-bg">
          <Mark className="m-auto h-24" />
        </div>
      </SlashReveal>
      <Button variant="secondary" size="sm" className="w-fit" onClick={() => setKey(key + 1)}>
        {t("Replay", "أعد التشغيل")}
      </Button>
    </Stack>
  );
}