diff options
Diffstat (limited to 'examples/component/packages/my-component/Button.astro')
-rw-r--r-- | examples/component/packages/my-component/Button.astro | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/component/packages/my-component/Button.astro b/examples/component/packages/my-component/Button.astro new file mode 100644 index 000000000..d853628a1 --- /dev/null +++ b/examples/component/packages/my-component/Button.astro @@ -0,0 +1,15 @@ +--- +export interface Props extends Record<any, any> { + type?: string +} + +const { + type, + ...props +} = { + ...Astro.props +} as Props + +props.type = type || 'button' +--- +<button {...props}><slot /></button>
\ No newline at end of file |