「動く枠線カード」は Pro に含まれます。解除するとプレビューが表示されます。
「展開図と折りたたみ」は Pro に含まれます。解除するとプレビューが表示されます。
仕組み
平らな展開図が折りたたまれて立体になる様子を示す教科書風の図です。展開図はニュートラルな色の軸測図で、自分の破線の輪郭の上に置かれています。1 ステップごとに 1 つの面が折り線を軸に回転します。立方体は 90°、正四角錐の三角形は 125.3°、正四面体は 109.5° で、ちょうど立体が閉じる角度です。今のステップで折った面だけがアクセント色で、番号もアクセント色のバッジで示されます。まだ平らな折り線は破線のままです。図の下の行がステップの内容を説明し、立体が閉じると頂点・辺・面の数でオイラーの公式を確かめます。
向いている場面
- Teaching nets of polyhedra: which flat pattern folds into which solid, and in what order.
- Showing a step-by-step physical process where each step turns one part about a hinge.
向かない場面
- Free 3D rotation of a model; this figure keeps one fixed axonometric view.
- Long procedures with many branches; use a regular stepper or a list.
使い方
import { HingedExhibition } from './HingedExhibition.jsx'
export function CubeNet() {
return (
<HingedExhibition
solid="cube"
defaultStep={0}
labels={{ title: 'Net of a cube' }}
onStepChange={(step, { closed }) => console.log(step, closed)}
/>
)
}プロパティ
| プロパティ | 型 | 既定値 | 説明 |
|---|---|---|---|
solid | 'cube' | 'pyramid' | 'tetrahedron' | 'cube' | The net: six squares in a cross (5 folds), a square with four equilateral triangles (4 folds), or four equilateral triangles (3 folds). |
step | number | — | Controlled number of folds made, from 0 (flat) to the number of fold lines (closed). Pair with onStepChange. |
defaultStep | number | half the folds, rounded up | Starting number of folds when uncontrolled. |
onStepChange | (step: number, info: { flat: boolean, closed: boolean }) => void | — | Called when a button or key asks for another step, with the new number of folds. |
labels | object | — | Replace any text: title, caption, solids { cube, pyramid, tetrahedron }, flatTitle, flatText ({faces}, {folds}), foldTitle ({face}), foldText ({angle}), closedTitle ({solid}), closedText ({v}, {e}, {f}), counter ({n}, {count}), figure, previous, next. |
locale | string | 'en' | Locale used to format the fold angle. |
アクセシビリティ
- Tab reaches the two step buttons; Enter or Space folds or unfolds one step. While focus is inside the card, Left and Right step, Home flattens the net and End closes the solid.
- At either end the button stays focusable with aria-disabled, so focus is never lost. A polite live region announces the fold number, the step title and its text. Both buttons are 44 pixels.
モーション
1 ステップで面を 560ms かけてイーズインアウトで折る、または開きます。Home と End はすぐに到達します。視差効果を減らす設定では各ステップが即座に表示され、アクセント色の面と説明は同じです。
プロジェクトに追加
Pro メンバーはプロンプトをコピーし、コーディングエージェントが無料コンポーネントと同じ手順でソースを導入します。
HingedExhibition.jsxhinged-exhibition.csstokens.cssREADME.md
2 つのファイルを一緒に導入します。スタイルは tokens.css の変数を読み、予備の値も持つため、単体でも表示できます。
同じカテゴリ
カード「ビームボーダー」は Pro に含まれます。解除するとプレビューが表示されます。
「カード詳細とロック」は Pro に含まれます。解除するとプレビューが表示されます。







