```ts // YourComponent.stories.js import React from 'react'; import { Story, Meta } from '@storybook/react'; import { YourComponent, YourComponentProps } from './your-component'; //👇 Some function to demonstrate the behavior const someFunction = (valuePropertyA, valuePropertyB) => { // Makes some computations and returns something }; export default { component: YourComponent, title: 'A complex case with a function', //👇 Creates specific argTypes with options argTypes: { propertyA: { options: ['Item One', 'Item Two', 'Item Three'], control: { type: 'select' } // Automatically inferred when 'options' is defined }, propertyB: { options: ['Another Item One', 'Another Item Two', 'Another Item Three'], }, }, } as Meta; const Template: Story = ({ propertyA, propertyB, ...rest }) => { //👇 Assigns the result from the function to a variable const someFunctionResult = someFunction(propertyA, propertyB); return ; }; ```