Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

pass direction as an arg in the list demo

Roman Pominovc8f5b8a34186
diff --git a/packages/design-system/src/components/primitives/dnd/sortable-list.stories.tsx b/packages/design-system/src/components/primitives/dnd/sortable-list.stories.tsx
index bfca46e3f6..526c2baa6d 100644
--- a/packages/design-system/src/components/primitives/dnd/sortable-list.stories.tsx
+++ b/packages/design-system/src/components/primitives/dnd/sortable-list.stories.tsx
@@ -38,11 +38,11 @@ const Item = ({
};
export const SortableList = ({
- direction = "vertical",
- reversed = false,
+ direction,
+ reversed,
}: {
- direction?: "horizontal" | "vertical" | "wrap";
- reversed?: boolean;
+ direction: "horizontal" | "vertical" | "wrap";
+ reversed: boolean;
}) => {
const [data, setData] = useState([
{ id: "0", text: "First" },
@@ -183,18 +183,14 @@ export const SortableList = ({
);
};
-export const SortableListHorizontal = (args: Args) => (
- <SortableList direction="horizontal" {...args} />
-);
-
-export const SortableListWrap = (args: Args) => (
- <SortableList direction="wrap" {...args} />
-);
-
-type Args = { reversed: boolean };
-
export default {
args: {
+ direction: "vertical",
reversed: false,
},
+ argTypes: {
+ direction: {
+ control: { type: "select", options: ["horizontal", "vertical", "wrap"] },
+ },
+ },
} as ComponentMeta<typeof SortableList>;