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

@storybook/theming

Package Overview
Dependencies
Maintainers
11
Versions
1816
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/theming

Core Storybook Components

  • 8.5.0-alpha.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9.9M
increased by8.6%
Maintainers
11
Weekly downloads
 
Created

What is @storybook/theming?

The @storybook/theming package is designed to help you customize the appearance of Storybook, an open-source tool for developing UI components in isolation. It allows you to create themes that can change the look and feel of Storybook's user interface to match your project's branding or style guidelines.

What are @storybook/theming's main functionalities?

Creating custom themes

This feature allows you to define a custom theme for Storybook by specifying various properties such as base theme (light or dark), brand title, brand URL, brand image, and primary and secondary colors.

{
  "base": "light",
  "brandTitle": "My Custom Storybook",
  "brandUrl": "https://mycompany.com",
  "brandImage": "https://mycompany.com/logo.svg",
  "colorPrimary": "#ff4785",
  "colorSecondary": "#1EA7FD"
}

Applying custom themes

This code sample demonstrates how to apply a built-in dark theme from the @storybook/theming package to your Storybook instance using the addParameters function.

import { themes } from '@storybook/theming';
import { addParameters } from '@storybook/react';

addParameters({
  options: {
    theme: themes.dark
  }
});

Extending existing themes

This feature allows you to extend an existing theme (in this case, the default light theme) and customize it further by overriding specific properties such as colors, background, border, typography, and more.

import { create } from '@storybook/theming';
import { themes } from '@storybook/theming';

export default create({
  base: 'light',
  brandTitle: 'Custom Storybook',
  ...themes.light,
  colorPrimary: 'hotpink',
  colorSecondary: 'deepskyblue',

  // UI
  appBg: 'white',
  appContentBg: 'silver',
  appBorderColor: 'grey',
  appBorderRadius: 4,

  // Typography
  fontBase: '"Open Sans", sans-serif',
  fontCode: 'monospace',

  // Text colors
  textColor: 'black',
  textInverseColor: 'rgba(255,255,255,0.9)',

  // Toolbar default and active colors
  barTextColor: 'silver',
  barSelectedColor: 'black',
  barBg: 'hotpink',

  // Form colors
  inputBg: 'white',
  inputBorder: 'silver',
  inputTextColor: 'black',
  inputBorderRadius: 4
});

Other packages similar to @storybook/theming

Keywords

FAQs

Package last updated on 19 Nov 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