Skip to content

Commit

Permalink
Add Storybook for typewriter component
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishit30G committed Dec 26, 2024
1 parent 61d7404 commit 53f3721
Showing 1 changed file with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* Internal dependencies
*/
import TypewriterOrIEBypass from '../';

/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';

const meta = {
title: 'BlockEditor/Typewriter',
component: TypewriterOrIEBypass,
parameters: {
docs: {
description: {
component:
'The `Typewriter` component ensures that the text selection keeps the same vertical distance from the viewport during keyboard events within this component. It provides a typewriter-like behavior for its children.',
},
canvas: { sourceState: 'shown' },
},
},
argTypes: {
children: {
control: 'text',
description: 'The children of the component.',
table: {
type: { summary: 'string' },
},
},
},
};

export default meta;

export const Default = {
args: {
children: __( 'Typewriter Text' ),
},
render( { children } ) {
return <TypewriterOrIEBypass>{ children }</TypewriterOrIEBypass>;
},
};

0 comments on commit 53f3721

Please sign in to comment.