In TypeScript I have a certain type of the values called
export type Align = 'start' | 'end' | 'center';
For the Component Story I would like to make one prop interactive for the user, for this I am adding a select control to the panel, is there a way to list options by referring to the type Align rather than copypasting the values ?
SomeStory.argTypes = {
align: {
control: 'select',
options: ???,
// options: ['start' , 'end' , 'center']
}
};
You cannot convert a type to an array of values, but you can achieve it in the opposite way
Playground