Let's say I have a table component and I want to specify the structure of the columnList property in CSF notation. The component has an argument/property which takes a list of column definitions.
For example:
[
{name: "id", label: "Id", sortable: true},
{name: "firstName", label: "Firstname", sortable: true},
{name: "lastName", label: "Lastname", sortable: true},
]
Then how should the story be defined?
export default {
title: 'Table',
component: NgxTableComponent,
argTypes: {
title: {
type: {name: 'string', required: false}
},
columnList: {
type: {name: ???, required: true}
}
}
};
What should the ??? be?
In JSON-Schema notation this would be:
{
"type": "array",
"items": {
"type": "object",
"properties": {
"name": "string",
"label": "string",
"sortable" "boolean"
}
}
}
Can this be achieved in CSF?
Is it then possible to have (via add-on?) a Control in Storybook to define this columnList?