ComponentsLayout & grids
Shoji Reveal
Paper screens on wooden lattices that slide apart, overlapping as they go, to show what is behind them.
This example uses generated pictures from this site: art.ts. Copy that file from the repository, or use your own images in its place.
"use client";
import { useState } from "react";
import { Button } from "@/components/miyuki-ui/button";
import { ShojiReveal } from "@/components/miyuki-ui/shoji-reveal";
import { landscape } from "@/registry/lib/art";
const view = landscape("kiso-room-12", { width: 1280, height: 720, mood: "snow" });
export default function ShojiRevealDemo() {
const [open, setOpen] = useState(false);
return (
<div className="flex w-full max-w-[640px] flex-col items-center gap-5">
<ShojiReveal open={open} onOpenChange={setOpen} className="aspect-[16/9] w-full">
<img src={view} alt="Snow on the ridges above the Kiso valley" className="size-full object-cover" />
</ShojiReveal>
<Button variant="secondary" onPress={() => setOpen(!open)}>
{open ? "Close the screens" : "Open the screens"}
</Button>
</div>
);
}Install
npx shadcn@latest add @miyuki-ui/shoji-revealThis needs the @miyuki-ui registry in your components.json. See Using the shadcn CLI.
Props
ShojiReveal
Prop
Type
Page Curl
A booklet page whose lower corner lifts into a curl when you reach for it, showing its underside and the page beneath; drag it past halfway to turn, or pull the last page back from the left.
Tatami Grid
Lays its children out as tatami mats, half or full, arranged so that four corners never meet, and re-lays the room with a layout animation when mats are added, removed or resized.