SwapText

Text that changes with state in a place sized for its widest version, so nothing around it moves.

View source
Activeproduction
import { SwapText } from "@logicplanes/kaeso-ui";

Props

  • align
    "start" | "center" = center

    Aligns the shorter labels at the start or in the center of the reserved width.

  • children
    ReactNode

    What is shown now.

  • reserve
    ReactNode[]

    Every text this place can show ("Copy page", "Copied"). The width fits the widest, so a state change never resizes the control.

  • wrap
    boolean = false

    Lets longer texts, such as a field's hint, wrap within their column; the height then fits the tallest, so nothing below moves.