Cómo funciona
Una figura de libro de texto: un desarrollo plano que se pliega hasta formar un sólido. El desarrollo es un dibujo axonométrico en tonos neutros apoyado sobre su propio contorno a trazos. Cada paso gira una cara sobre su pliegue: 90° en el cubo, 125,3° en los triángulos de la pirámide y 109,5° en el tetraedro, los ángulos que cierran cada sólido. La cara plegada en el paso actual es la única forma en el color de acento, con su número en una insignia; los pliegues aún planos siguen a trazos. La fila bajo la figura explica el paso y, con el sólido cerrado, comprueba la fórmula de Euler con sus vértices, aristas y caras.
Úsalo para
- 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.
Busca otra opción cuando
- 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.
Uso
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)}
/>
)
}Propiedades
| Propiedad | Tipo | Por defecto | Qué hace |
|---|---|---|---|
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. |
Accesibilidad
- 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.
Movimiento
Cada paso pliega o despliega la cara en 560 ms con una curva de entrada y salida suaves; Inicio y Fin llegan de inmediato. Con movimiento reducido cada paso aparece al instante, con la misma cara de acento y el mismo texto.
Añádelo a tu proyecto
Los miembros Pro copian un prompt y su agente de programación instala el código, igual que con los gratuitos.
HingedExhibition.jsxhinged-exhibition.csstokens.cssREADME.md
Los dos archivos se instalan juntos. La hoja de estilos lee las variables de tokens.css y lleva valores de reserva, así que también funciona sola.







