Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support highlighted lines using LineNumbers #256

Closed
metonym opened this issue Dec 30, 2022 · 1 comment · Fixed by #266
Closed

Support highlighted lines using LineNumbers #256

metonym opened this issue Dec 30, 2022 · 1 comment · Fixed by #266
Labels
enhancement New feature or request

Comments

@metonym
Copy link
Owner

metonym commented Dec 30, 2022

It would be nice if specific lines could be highlighted in the LineNumbers component.

A prop called highlightedLines could accept an array of line indices to highlight (zero-indexed).

<LineNumbers {highlighted} highlightedLines={[0, 1]} />

A custom color could be applied through a style prop.

<LineNumbers
  {highlighted}
  highlightedLines={[0, 1]}
  --highlighted-background="rgba(255, 255, 255, 0.4)"
/>
@metonym metonym changed the title Allow lines to be highlighted Support highlighted lines using LineNumbers Dec 30, 2022
@metonym metonym added the enhancement New feature or request label Dec 30, 2022
@nicholasmordecai
Copy link

+1, this would be cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants