Creates a horizontal layout component that arranges content in a row.
Either the content to display or the options object
Configuration object
if true, the flex property will be set to 1
align-items property - default is 'stretch'
justify-content property - default is 'flex-start'
Spacing between items in pixels
Padding around the container in pixels (number or array of numbers)
Margin around the container in pixels (number or array of numbers)
Width of the container (default: 'auto')
Custom CSS styles to apply to the container
The content to display (only used when options are provided)
A JSX element representing the horizontal layout component
Basic usage with content
horizontal([ inputField({ name: 'firstName', label: 'First name', defaultValue: 'Jane', }), inputField({ name: 'lastName', label: 'Last name', defaultValue: 'Doe', }),]); Copy
horizontal([ inputField({ name: 'firstName', label: 'First name', defaultValue: 'Jane', }), inputField({ name: 'lastName', label: 'Last name', defaultValue: 'Doe', }),]);
Usage with options and content
horizontal( { gap: 8, align: 'center', justify: 'space-between', padding: 16, }, [ inputField({ name: 'email', label: 'Email', type: 'email', }), inputField({ name: 'phone', label: 'Phone', type: 'tel', }), ]); Copy
horizontal( { gap: 8, align: 'center', justify: 'space-between', padding: 16, }, [ inputField({ name: 'email', label: 'Email', type: 'email', }), inputField({ name: 'phone', label: 'Phone', type: 'tel', }), ]);
Creates a horizontal layout component that arranges content in a row.
Param: optionsOrContent
Either the content to display or the options object
Param: options
Configuration object
Param: options.flex
if true, the flex property will be set to 1
Param: options.align
align-items property - default is 'stretch'
Param: options.justify
justify-content property - default is 'flex-start'
Param: options.gap
Spacing between items in pixels
Param: options.padding
Padding around the container in pixels (number or array of numbers)
Param: options.margin
Margin around the container in pixels (number or array of numbers)
Param: options.width
Width of the container (default: 'auto')
Param: options.style
Custom CSS styles to apply to the container
Param: content
The content to display (only used when options are provided)
Returns
A JSX element representing the horizontal layout component
Example
Basic usage with content
Example
Usage with options and content