mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-01 05:05:25 +08:00
16 lines
354 B
TypeScript
16 lines
354 B
TypeScript
import React from 'react';
|
|
import { addons, types } from '@storybook/addons';
|
|
|
|
const ID = 'local-addon';
|
|
|
|
const LocalAddonPanel = () => <>Local addon</>;
|
|
|
|
addons.register(ID, (api) =>
|
|
addons.add(ID, {
|
|
title: ID,
|
|
type: types.PANEL,
|
|
match: () => true,
|
|
render: ({ active, key }) => (active ? <LocalAddonPanel key={key} /> : null),
|
|
})
|
|
);
|