Security News
Internet Archive Hacked, 31 Million Record Compromised
The Internet Archive's "Wayback Machine" has been hacked and defaced, with 31 millions records compromised.
@storybook/addon-highlight
Advanced tools
Storybook addon allows for highlighting specific DOM nodes within your story.
Use it to call attention to particular parts of the story. Or use it to enhance other addons that you might be building. For example, Accessibility addon uses it to highlight DOM nodes that are failing accessibility checks.
This addon requires Storybook 6.5 or later. Highlight is part of essentials and so is installed in all new Storybooks by default. If you need to add it to your Storybook, you can run:
npm i -D @storybook/addon-highlight
Add "@storybook/addon-highlight"
to the addons array in your .storybook/main.js
:
module.exports = {
addons: ['@storybook/addon-highlight'],
};
Highlight DOM nodes by emitting the HIGHLIGHT
event from within a story or an addon. The event payload must contain a list of selectors you want to highlight.
import React, { useEffect } from 'react';
import { useChannel } from '@storybook/preview-api';
import { HIGHLIGHT, RESET_HIGHLIGHT } from '@storybook/addon-highlight';
import { MyComponent } form './MyComponent';
export default { component: MyComponent };
export const MyStory = () => {
const emit = useChannel({});
useEffect(() => {
emit(HIGHLIGHT, {
elements: ['.title', '.subtitle'],
});
}, []);
return <MyComponent />;
};
Highlights are automatically cleared when the story changes. You can also manually clear them by emitting the RESET_HIGHLIGHT
event.
emit(RESET_HIGHLIGHT);
emit(HIGHLIGHT, {
elements: ['.title', '.subtitle'],
color: 'red',
style: 'solid', // 'dotted' | 'dashed' | 'solid' | 'double'
});
7.0.0-alpha.55 (November 30, 2022)
.mdx
globs in templates and defaults #19795exports.ts
file in a single pass without exec
#20002className
prop, cleanup UI SB `preview.tsx #19886FAQs
Highlight DOM nodes within your stories
The npm package @storybook/addon-highlight receives a total of 3,537,638 weekly downloads. As such, @storybook/addon-highlight popularity was classified as popular.
We found that @storybook/addon-highlight demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 11 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Internet Archive's "Wayback Machine" has been hacked and defaced, with 31 millions records compromised.
Security News
TC39 is meeting in Tokyo this week and they have approved nearly a dozen proposals to advance to the next stages.
Security News
Our threat research team breaks down two malicious npm packages designed to exploit developer trust, steal your data, and destroy data on your machine.