Skip to main content

DiffView

Function DiffView 

Source
pub fn DiffView(_: DiffViewProps) -> Element
Expand description

The difference between two texts, line by line, with counts above.

Colour is never the only cue: added and removed lines also differ in their +/− glyph, their accessible label, and data-fc-diff. Folded unchanged lines stay in the DOM, hidden, so a machine reading the diff sees all of it.

§Props

For details, see the props struct definition.

  • before : String
  • after : String
  • scroll : Option<AccessibleName>

    Keep lines whole and scroll sideways, in a focusable region named by this.

  • context : Option<usize>

    Fold unchanged runs, keeping this many lines around each change.

  • class : Option<String>
  • attributes : Vec<Attribute>