storybook/docs/snippets/common/storybook-addons-api-useparameter.js.mdx

18 lines
337 B
Plaintext

```js
// /my-addon/register.js
import React from 'react';
import { useParameter } from '@storybook/api';
export const Panel = () => {
const value = useParameter('parameter-key', 'default value');
return (
<div>
for the currently selected story, the parameter for "parameter-key" is:
{value}
</div>
);
};
```