Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

storybook-addon-pseudo-states

Package Overview
Dependencies
Maintainers
1
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

storybook-addon-pseudo-states

CSS pseudo states for Storybook

  • 4.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is storybook-addon-pseudo-states?

The storybook-addon-pseudo-states npm package is a Storybook addon that allows you to easily visualize and test CSS pseudo-states (like :hover, :focus, :active, etc.) for your components. This is particularly useful for UI development, as it helps you ensure that your components look and behave correctly in different states without having to manually trigger those states.

What are storybook-addon-pseudo-states's main functionalities?

Visualize CSS Pseudo-States

This feature allows you to visualize different CSS pseudo-states like :hover, :focus, and :active for your components. By using the `withPseudo` decorator and setting the `pseudo` parameters, you can see how your component looks in these states.

import { withPseudo } from 'storybook-addon-pseudo-states';

export default {
  title: 'Button',
  component: Button,
  decorators: [withPseudo],
};

export const PseudoStates = () => <Button>Hover me</Button>;
PseudoStates.parameters = {
  pseudo: { hover: true, focus: true, active: true },
};

Custom Pseudo-States

This feature allows you to define and visualize custom pseudo-states for your components. By setting custom pseudo-state names in the `pseudo` parameters, you can test how your component behaves in these custom states.

import { withPseudo } from 'storybook-addon-pseudo-states';

export default {
  title: 'CustomButton',
  component: CustomButton,
  decorators: [withPseudo],
};

export const CustomPseudoStates = () => <CustomButton>Custom State</CustomButton>;
CustomPseudoStates.parameters = {
  pseudo: { 'custom-state': true },
};

Other packages similar to storybook-addon-pseudo-states

Keywords

FAQs

Package last updated on 04 Sep 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc