Best JavaScript code snippet using storybook-root
layout.stories.js
Source:layout.stories.js
1import React from 'react';2// eslint-disable-next-line react/prop-types3const Box = ({ children, display = 'block' }) => (4 <div style={{ display, border: '2px solid #FF4785', padding: 10 }}>{children}</div>5);6export default {7 title: 'Core/Layout',8};9export const Default = () => <Box>padded by default</Box>;10export const PaddedBlock = () => <Box>padded</Box>;11PaddedBlock.parameters = { layout: 'padded' };12export const PaddedInline = () => <Box display="inline-block">padded</Box>;13PaddedInline.parameters = { layout: 'padded' };14export const FullscreenBlock = () => <Box>fullscreen</Box>;15FullscreenBlock.parameters = { layout: 'fullscreen' };16export const FullscreenInline = () => <Box display="inline-block">fullscreen</Box>;17FullscreenInline.parameters = { layout: 'fullscreen' };18export const CenteredBlock = () => <Box>centered</Box>;19CenteredBlock.parameters = { layout: 'centered' };20export const CenteredInline = () => <Box display="inline-block">centered</Box>;21CenteredInline.parameters = { layout: 'centered' };22export const Invalid = () => <Box>invalid layout value</Box>;...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!