@storybook/addons#useArgs TypeScript Examples
The following examples show how to use
@storybook/addons#useArgs.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Modal.stories.tsx From web3uikit with MIT License | 6 votes |
Template: ComponentStory<typeof Modal> = (args) => {
const [{}, updateArgs] = useArgs();
return (
<div>
<Modal
{...args}
onCancel={() => {
console.log('canceled');
updateArgs({ isVisible: false });
}}
onOk={() => {
console.log('pressed ok');
updateArgs({ isVisible: false });
}}
onCloseButtonPressed={() => {
console.log('pressed close');
updateArgs({ isVisible: false });
}}
/>
</div>
);
}
Example #2
Source File: WalletModal.stories.tsx From web3uikit with MIT License | 6 votes |
Template: ComponentStory<typeof WalletModal> = (args) => {
const [{}, updateArgs] = useArgs();
return (
<WalletModal
{...args}
setIsOpened={() => updateArgs({ isOpened: false })}
/>
);
}