Saltar al contenido
Neshel-UI
Animaciones (experimental)Referencia

@neshel-ui/animations/layout

Todas las exportaciones de @neshel-ui/animations/layout, generadas desde sus declaraciones.

Experimental y no disponible en npm

@neshel-ui/animations es un paquete privado (0.0.0). No se puede instalar y su API puede cambiar antes de una primera publicación. Estas páginas documentan lo que existe en el repositorio.

Firmas, miembros y valores por defecto, generados desde las declaraciones compiladas. Las explicaciones y los ejemplos están en la guía.

Las descripciones de esta referencia se generan desde el código fuente del paquete y se muestran en inglés; las guías y el catálogo están en español.

  • AnimatedList component

    A list whose items enter and exit (L03) while the remaining items FLIP into place (L01).

    (props: AnimatedListProps): Element
  • AutoHeight component

    A wrapper whose height follows its content smoothly (async content, text growing).

    (props: AutoHeightProps): Element
  • Collapse component

    An expanding/collapsing panel (L06). Wire your trigger with `aria-expanded` and `aria-controls={id}`; the closed content stays in the DOM (`hidden="until-found"` where supported). Needs `layout.css`.

    (props: CollapseProps): Element
  • CrossFade component

    Content cross-fade swap (L09): old and new content overlap in one grid cell; the height follows (L02).

    (props: CrossFadeProps): Element
  • LayoutItem component

    An element that FLIPs to its new layout box whenever an update of its group moves or resizes it.

    (props: LayoutItemProps): Element
  • Masonry component

    A masonry grid (row spans from observed heights) whose reflows animate (L10). Needs `layout.css`.

    (props: MasonryProps): Element
  • Presence component
    (props: PresenceProps): Element
  • Reflow component

    Children animate whenever the container reflows (resize, column change, size change) — no renders.

    (props: ReflowProps): Element
  • TabIndicator component

    A sliding indicator under the active tab (package-rendered layer; CSS transition on it only).

    (props: TabIndicatorProps): Element
  • createLayoutGroup function
    (): LayoutGroup
  • createPresence function
    <T>(): Presence<T>
  • getLayoutDebugInfo function
    (): LayoutDebugInfo
  • measureBox function

    Layout box of an element (offset chain + `offsetWidth/Height`), or the bounding box plus scroll for non-HTML elements (their transforms are then included — documented).

    (element: Element): Box
  • useIsPresent function

    Whether this component is present (`false` while it exits).

    (): boolean
  • useLayoutGroup function

    The nearest `<LayoutGroup>`'s group (`null` outside one): `snapshot()` / `play()` for imperative changes.

    (): LayoutGroup | null
  • useLayoutItem function

    Attach the FLIP effect of the nearest group to `ref` (for custom components; see `<LayoutItem>`).

    (ref: RefObject<Element | null>, options?: LayoutItemOptions | undefined): void
  • usePresence function

    `[isPresent, safeToRemove]` for a custom child of `<Presence>`; `[true, noop]` outside one.

    (): [boolean, () => void]
  • autoHeight const
    Readonly<EffectDefinition<AutoHeightOptions, ResolvedHeight>>
  • collapse const
    Readonly<EffectDefinition<CollapseOptions, ResolvedCollapse>>
  • crossFade const
    Readonly<EffectDefinition<CrossFadeOptions, ResolvedCrossFade>>
  • flipMove const
    Readonly<EffectDefinition<FlipMoveOptions, ResolvedFlip>>
  • gridReflow const
    Readonly<EffectDefinition<GridReflowOptions, ResolvedReflow>>
  • layoutEffects const

    Every layout definition in catalogue order (L01–L07, L09, L10; L08 is `<Presence>`), for registries.

    readonly AnyEffectDefinition[]
  • listItem const
    Readonly<EffectDefinition<ListItemOptions, ResolvedListItem>>
  • masonry const
    Readonly<EffectDefinition<MasonryOptions, ResolvedMasonry>>
  • sharedLayout const
    Readonly<EffectDefinition<SharedLayoutOptions, ResolvedFlip>>
  • tabIndicator const
    Readonly<EffectDefinition<TabIndicatorOptions, ResolvedIndicator>>
  • LayoutGroup class

    Owns a layout group for the items rendered inside it (L01, L03, L04).

  • AnimatedListProps interface

    AnimatedListProps

    AnimatedListProps
    PropTipoPredeterminadoDescripción
    as"ul" | "ol" | "div""ul"List element (default "ul").
    childrenReactNode—Keyed items, each accepting a ref.
    durationnumber240Item enter/exit duration in ms (default 240).
    initialbooleanfalseAnimate the first render's items (default false).
    onExitComplete(key: string) => void——
    reducedMotionReducedMotion——
    refRef<HTMLElement>——
    transitionLayoutTransition——

    También acepta las props de: React DOM attributes.

  • AutoHeightOptions interface

    AutoHeightOptions

    L02 — Altura automática: la altura del elemento sigue a la altura observada de su contenido.

    AutoHeightOptions
    PropTipoPredeterminadoDescripción
    durationnumber | DurationPreset280ms o preset (por defecto 280).
    easingEasing | EasingPreset——
    reducedMotionReducedMotion——
  • AutoHeightProps interface

    AutoHeightProps

    AutoHeightProps
    PropTipoPredeterminadoDescripción
    childrenReactNode——
    durationnumber | DurationPreset——
    easingEasing | EasingPreset——
    reducedMotionReducedMotion——
    refRef<HTMLDivElement>——

    También acepta las props de: React DOM attributes.

  • Box interface

    Box

    A layout box in document coordinates (transforms ignored).

    Box
    PropTipoPredeterminadoDescripción
    height(obligatoria)number——
    width(obligatoria)number——
    x(obligatoria)number——
    y(obligatoria)number——
  • CollapseOptions interface

    CollapseOptions

    L06 — Altura de acordeón (contrae / expande un panel del paquete).

    CollapseOptions
    PropTipoPredeterminadoDescripción
    driver"auto" | "css" | "js"—"auto" (por defecto): CSS interpolate-size donde existe; si no, WAAPI medido.
    durationnumber | DurationPreset280ms o preset (por defecto 280).
    easingEasing | EasingPreset——
    onRequestOpen() => void—La búsqueda en la página encontró contenido oculto: pide abrir el panel.
    openboolean—Estado expandido (controlado por ti).
    reducedMotionReducedMotion——
  • CollapseProps interface

    CollapseProps

    CollapseProps
    PropTipoPredeterminadoDescripción
    childrenReactNode——
    driver"auto" | "css" | "js"—"auto" (por defecto): CSS interpolate-size donde existe; si no, WAAPI medido.
    durationnumber | DurationPreset280ms o preset (por defecto 280).
    easingEasing | EasingPreset——
    onRequestOpen() => void—La búsqueda en la página encontró contenido oculto: pide abrir el panel.
    open(obligatoria)boolean——
    reducedMotionReducedMotion——
    refRef<HTMLDivElement>——

    También acepta las props de: React DOM attributes.

  • CrossFadeOptions interface

    CrossFadeOptions

    L09 — Fundido de contenido (una capa del cambio; <CrossFade> apila dos).

    CrossFadeOptions
    PropTipoPredeterminadoDescripción
    appearboolean—Aparece con fundido al adjuntarse visible (por defecto false: el contenido SSR sigue visible).
    durationnumber | DurationPreset——
    easingEasing | EasingPreset——
    onHidden() => void—Se llama cada vez que la capa ha desaparecido.
    reducedMotionReducedMotion——
    visibleboolean—Visible (aparece) u oculta (desaparece). Por defecto true.
  • CrossFadeProps interface

    CrossFadeProps

    CrossFadeProps
    PropTipoPredeterminadoDescripción
    childrenReactNode——
    durationnumber——
    reducedMotionReducedMotion——
    refRef<HTMLDivElement>——
    swapKey(obligatoria)string | number—Change it to swap the content (old and new cross-fade while the height follows).

    También acepta las props de: React DOM attributes.

  • FlipMoveOptions interface

    FlipMoveOptions

    L01 — Movimiento / reordenación FLIP (y L04, layout compartido con layoutId).

    FlipMoveOptions
    PropTipoPredeterminadoDescripción
    groupLayoutGroup—El grupo cuyo ciclo snapshot/play anima este elemento (createLayoutGroup(); <LayoutGroup>).
    layoutLayoutMode"position"Qué se anima (por defecto "position"; "size"/"both" añaden una escala no uniforme).
    reducedMotionReducedMotion——
    transitionLayoutTransition——
  • GridReflowOptions interface

    GridReflowOptions

    L05 — Reflujo de cuadrícula.

    GridReflowOptions
    PropTipoPredeterminadoDescripción
    reducedMotionReducedMotion——
    transitionLayoutTransition——
  • LayoutDebugInfo interface

    LayoutDebugInfo

    LayoutDebugInfo
    PropTipoPredeterminadoDescripción
    observers(obligatoria)number——
    plays(obligatoria)number——
    reads(obligatoria)number——
    reflows(obligatoria)number——
    snapshots(obligatoria)number——
    watchdog(obligatoria)number——
  • LayoutEntry interface

    LayoutEntry

    LayoutEntry
    PropTipoPredeterminadoDescripción
    animate(obligatoria)() => boolean—false while motion is reduced: changes are applied without animation.
    animator(obligatoria)FlipAnimator——
    layout(obligatoria)LayoutMode——
    layoutId(obligatoria)string | undefined——
  • LayoutGroupHandle interface

    LayoutGroupHandle

    LayoutGroupHandle
    PropTipoPredeterminadoDescripción
    destroy(obligatoria)() => void——
    play(obligatoria)() => void—Measure the new boxes in the next read phase and animate the changes.
    register(obligatoria)(element: Element, entry: LayoutEntry) => () => void—Register an element; returns the unregister function.
    size(obligatoria)number——
    snapshot(obligatoria)() => void—Read every registered box (once per pending change; further calls are no-ops until play).
  • LayoutItemOptions interface

    LayoutItemOptions

    LayoutItemOptions
    PropTipoPredeterminadoDescripción
    layoutLayoutMode——
    layoutIdstring—Shared-layout id (L04): a new element with the same id animates from the old one's box.
    reducedMotionReducedMotion——
    transitionLayoutTransition——
  • LayoutItemProps interface

    LayoutItemProps

    LayoutItemProps
    PropTipoPredeterminadoDescripción
    asChildboolean—Apply to the single child element instead of rendering a <div>.
    childrenReactNode——
    layoutLayoutMode——
    layoutIdstring—Shared-layout id (L04): a new element with the same id animates from the old one's box.
    reducedMotionReducedMotion——
    refRef<HTMLDivElement>——
    transitionLayoutTransition——

    También acepta las props de: React DOM attributes.

  • ListItemOptions interface

    ListItemOptions

    L03 — Entrada / salida de un elemento de lista (opacidad, 4 % de escala y 8 px; los hermanos hacen FLIP en un grupo).

    ListItemOptions
    PropTipoPredeterminadoDescripción
    appearboolean—Anima la primera aparición (por defecto true; <AnimatedList> pone false en los iniciales).
    durationnumber | DurationPreset——
    easingEasing | EasingPreset——
    onExited() => void——
    presentboolean—Presente (entra) o saliendo (sale y después llama a onExited). Por defecto true.
    reducedMotionReducedMotion——
  • MasonryOptions interface

    MasonryOptions

    L10 — Reflujo de mampostería.

    MasonryOptions
    PropTipoPredeterminadoDescripción
    columnsnumber—Número fijo de columnas (1–12); omitido: tantas de minColumnWidth como quepan.
    gapnumber—Separación en px (0–96, por defecto 16).
    minColumnWidthnumber—Ancho mínimo de columna en px cuando se omite columns (80–800, por defecto 220).
    reducedMotionReducedMotion——
    transitionLayoutTransition——
    unitnumber—Unidad de fila en px para los tramos (1–32, por defecto 4).
  • MasonryProps interface

    MasonryProps

    MasonryProps
    PropTipoPredeterminadoDescripción
    childrenReactNode——
    columnsnumber—Número fijo de columnas (1–12); omitido: tantas de minColumnWidth como quepan.
    gapnumber—Separación en px (0–96, por defecto 16).
    minColumnWidthnumber—Ancho mínimo de columna en px cuando se omite columns (80–800, por defecto 220).
    reducedMotionReducedMotion——
    refRef<HTMLDivElement>——
    transitionLayoutTransition——
    unitnumber—Unidad de fila en px para los tramos (1–32, por defecto 4).

    También acepta las props de: React DOM attributes.

  • PresenceEntry interface

    PresenceEntry

    PresenceEntry
    PropTipoPredeterminadoDescripción
    generation(obligatoria)number—Increments on every status change; remove only acts on the generation it was given.
    key(obligatoria)string——
    status(obligatoria)PresenceStatus——
    value(obligatoria)T——
  • PresenceProps interface

    PresenceProps

    PresenceProps
    PropTipoPredeterminadoDescripción
    childrenReactNode—Elementos con key renderizados sin contenedor. Cada uno debe aceptar una ref que llegue a su elemento del DOM (los elementos nativos lo hacen; los componentes deben pasar ref), para dejar inerte el contenido que sale y retirarle el foco.
    durationnumber220Duración del fundido incluido en ms (por defecto 220).
    enterAnyPreset—Definición o preset de entrada para los hijos que entran (por defecto: el fundido incluido).
    exitAnyPreset—Definición o preset de entrada para los hijos que salen (por defecto: el fundido incluido).
    focusFallbackRefObject<HTMLElement | null>—Destino del foco cuando estaba en un hijo que sale y ningún hermano presente puede recibirlo.
    initialboolean—Anima también los hijos del primer render (por defecto false: el contenido del servidor sigue visible).
    onExitComplete(key: string) => void—Se llama una vez por key eliminada, tras su salida.
  • PresenceState interface

    PresenceState

    PresenceState
    PropTipoPredeterminadoDescripción
    entries(obligatoria)readonly PresenceEntry<T>[]——
    flush(obligatoria)() => boolean—Remove every exiting entry at once (container unmount, hidden page).
    remove(obligatoria)(key: string, generation: number) => boolean—An exit finished: remove the key if it is still exiting in generation.
    update(obligatoria)(next: ReadonlyArray<{ key: string; value: T; }>) => boolean—Merge the next ordered children; returns whether anything changed.
  • ReflowProps interface

    ReflowProps

    ReflowProps
    PropTipoPredeterminadoDescripción
    asChildboolean——
    childrenReactNode——
    reducedMotionReducedMotion——
    refRef<HTMLDivElement>——
    transitionLayoutTransition——

    También acepta las props de: React DOM attributes.

  • SharedLayoutOptions interface

    SharedLayoutOptions

    L04 — Layout compartido: el mismo elemento lógico, dibujado por otro nodo, se anima desde el anterior.

    SharedLayoutOptions
    PropTipoPredeterminadoDescripción
    groupLayoutGroup—El grupo cuyo ciclo snapshot/play anima este elemento (createLayoutGroup(); <LayoutGroup>).
    layoutLayoutMode"position"Qué se anima (por defecto "position"; "size"/"both" añaden una escala no uniforme).
    layoutIdstring—Id estable compartido por el elemento anterior y el nuevo (obligatorio).
    reducedMotionReducedMotion——
    transitionLayoutTransition——
  • TabIndicatorOptions interface

    TabIndicatorOptions

    L07 — Indicador de pestaña deslizante (indicador del paquete dentro de la lista de pestañas).

    TabIndicatorOptions
    PropTipoPredeterminadoDescripción
    activeElement | number | null—La pestaña activa: un elemento, su índice entre las pestañas ([role="tab"], si no los hijos) o null.
    durationnumber | DurationPreset——
    easingEasing | EasingPreset——
    orientation"horizontal" | "vertical"——
    reducedMotionReducedMotion——
  • TabIndicatorProps interface

    TabIndicatorProps

    TabIndicatorProps
    PropTipoPredeterminadoDescripción
    activeElement | number | null—La pestaña activa: un elemento, su índice entre las pestañas ([role="tab"], si no los hijos) o null.
    asChildboolean—Apply to your tab list element instead of rendering a <div>.
    childrenReactNode——
    durationnumber | DurationPreset——
    easingEasing | EasingPreset——
    orientation"horizontal" | "vertical"——
    reducedMotionReducedMotion——
    refRef<HTMLDivElement>——

    También acepta las props de: React DOM attributes.

  • LayoutMode type
    "position" | "size" | "both"
  • LayoutTransition type

    LayoutTransition

    Transition of layout animations: a spring (default) or a tween.

    LayoutTransition
    PropTipoPredeterminadoDescripción
    durationnumber | DurationPreset——
    easingEasing | EasingPreset——
    springSpringOptions | SpringPreset——
    type(obligatoria)"spring" | "tween"——
  • PresenceStatus type

    Presence state machine (Phase 012, shared from `src/core` since Phase 015 by `./layout` L08 and `./feedback` F06; contracts/layout-engine.md §7, research R8). Framework-free and pure: it merges successive keyed child lists, keeping removed keys in place as `exiting` until `remove(key, generation)` confirms their exit, and turning re-added keys back to `present`. Timers, animations and focus live in the caller (the React `<Presence>` item); every transition is idempotent, so a repeated `update` with the same list (StrictMode double render) changes nothing.

    "present" | "exiting"
Editar en GitHub