Skip to content

feat(kv-components): loading placeholder for text elements AD-411 - #877

Merged
emuvente merged 3 commits into
mainfrom
feature/AD-411-kv-loading-text
Aug 10, 2026
Merged

feat(kv-components): loading placeholder for text elements AD-411#877
emuvente merged 3 commits into
mainfrom
feature/AD-411-kv-loading-text

Conversation

@emuvente

@emuvente emuvente commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

This adds a new component, KvLoadingText, that can be used as a loading placeholder for text elements. It renders KvLoadingPlaceholder bars using display: inline-block; height: 1cap;, which makes the height of the bar match the font size and occupies space that matches the line-height. This means that the placeholder will perfectly match the size of the text it is standing in for as long as it is styled with the same classes, avoiding layout shift when loading completes:

Screenshot 2026-08-07 at 12 36 02 PM

See the storybook page for docs and more examples.

Renders a configurable number of shimmer bars sized to the line box of
the surrounding type style, so a loading placeholder reserves the space
its real text will occupy. Each bar is one cap height tall and sits on
the text baseline, and the line height comes from the inherited
line-height rather than a fixed pixel guess.

AD-411
Adds seven stories and the component docs page built from the standard
template. The ComparedWithRealText story puts every type style in the
scale beside the text it stands in for, at a fixed width per specimen so
the sample wraps to a known number of lines across breakpoints.

AD-411
Covers the rendered line count, values below one falling back to a
single line, fractional values rounding down, the last line shortening
only when there is more than one, and a class passed to the component
landing on its root element.

AD-411
@emuvente
emuvente requested a review from a team August 7, 2026 19:38
@emuvente
emuvente merged commit f3c4bf6 into main Aug 10, 2026
6 checks passed
@emuvente
emuvente deleted the feature/AD-411-kv-loading-text branch August 10, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants