Customize styling for LazyLog
mainThere are three primary ways to style the components:
1. Using style and containerStyle props
- Use the
styleprop on<LazyLog />to affect the core container styles. - Use the
containerStyleprop to affect the look or behavior of the scrollable region.
2. Overriding defaultProps.style
To avoid passing style objects repeatedly, you can override the defaultProps.style of internal components directly. For example, to change the color of all lines:
import Line from "@melloware/react-logviewer/build/Line";
Line.defaultProps.style = {
color: "green",
};Note: Overriding ANSI colors and styles is currently undocumented and may require inspecting source code.
3. Using CSS stylesheets
You can target the virtual list and its children using CSS classes. The main virtual list uses the react-lazylog class name. From there, you can target:
- Individual line
divs - Line number
atags - Line content
spantags