snippets added
This commit is contained in:
1 parent
6c10ae3461
commit
2080230313
18 files changed
+1083
-16
No files matched your search
@@ -0,0 +1,40 @@
|
||||
snippet boil "react component"
|
||||
import React from "react";
|
||||
|
||||
interface $1Props {
|
||||
}
|
||||
|
||||
const $1 = ({$2}: $1Props) => {
|
||||
return $0;
|
||||
};
|
||||
|
||||
export { $1 };
|
||||
export default $1;
|
||||
|
||||
snippet bstory "react fixture"
|
||||
import React from "react";
|
||||
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
||||
|
||||
import $1 from "./$1";
|
||||
|
||||
export default {
|
||||
title: '$1',
|
||||
component: $1,
|
||||
argTypes: {
|
||||
// https://storybook.js.org/docs/react/api/argtypes
|
||||
backgroundColor: { control: 'color' },
|
||||
onClick: { action: "clicked" },
|
||||
},
|
||||
} as ComponentMeta<typeof $1>;
|
||||
|
||||
// https://storybook.js.org/docs/react/writing-stories/introduction#using-args
|
||||
const Template: ComponentStory<typeof $1> = (args) => <$1 {...args} />;
|
||||
|
||||
export const Default = Template.bind({});
|
||||
// https://storybook.js.org/docs/react/writing-stories/args
|
||||
Default.args = {
|
||||
primary: true,
|
||||
label: '$1',
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user