Skip to content
LyEve UI v0.60.1

Layout & display

DiffView

What changed between two versions, one row per field. The kit draws the list, and working out what changed stays with the page.

Basic

Pass one entry per field that changed. Each row names its field and says what happened to it in a word, Added, Removed, Changed or Moved, so the kind of change never rests on color. A changed field shows its old value marked Removed above its new value marked Added. A move carries a sentence of your own, such as where the field went. A value emptied by the change reads "Empty".

  • Title Changed
    Removed

    Spring sale

    Added

    Spring sale, ends Friday

  • Subtitle Added

    Every plan, 20% off

  • Banner image Removed

    hero-winter.png

  • Pricing section Moved

    From position 4 to 2

  • Footer note Changed
    Removed

    Prices exclude tax.

    Added

    Empty

Long values

A value longer than 400 characters shows its first 400 and a Show all button. The cut falls between two characters a reader sees as whole, so an emoji or an accented letter is never split. Each button names its value to a screen reader, as in "Show all of Body, added", so a list of them can be told apart. Every value folds again when the page passes other changes.

  • Body Changed
    Removed

    Every plan is 20% off until Friday, and the discount stays for a full year. Every plan is 20% off until Friday, and the discount stays for a full year. Every plan is 20% off until Friday, and the discount stays for a full year. Every plan is 20% off until Friday, and the discount stays for a full year. Every plan is 20% off until Friday, and the discount stays for a full year. Every plan is 20% of

    Added

    Every plan is 20% off until Friday, and the discount stays for a full year. Every plan is 20% off until Friday, and the discount stays for a full year. Every plan is 20% off until Friday, and the discount stays for a full year. Every plan is 20% off until Friday, and the discount stays for a full year. Every plan is 20% off until Friday, and the discount stays for a full year. Every plan is 20% of

Direction and sameness

Every label and value takes its direction from its own text, so an Arabic or Hebrew value reads right to left inside a left-to-right page, and the other way round. With no changes the list says "These versions are the same."

API

PropTypeDefaultDescription
changes requiredDiffChange[] no defaultOne entry per field that changed, in the order to list them.
class string no defaultExtra classes on the wrapper.

DiffChange

A union on kind: an added, removed or moved field carries value, and a changed one carries before and after.

PropTypeDefaultDescription
kind required'added' | 'removed' | 'changed' | 'moved' no defaultWhat happened to the field. It sets the word on the row.
label requiredstring no defaultThe field's name, shown first on the row.
value string no defaultThe value added or removed. For a move, where it went in your words, such as "From position 2 to 4".
before string no defaultThe old value of a changed field.
after string no defaultThe new value of a changed field.