# elementor/3.8.0-beta1/app/assets/js/ui/atoms/text.js

Elementor Website Builder – more than just a page builder, version 3.8.0-beta1. 30 lines.

- Page: https://pluginprobe.com/plugins/elementor/3.8.0-beta1/code/app/assets/js/ui/atoms/text.js
- Raw: https://pluginprobe.com/plugins/elementor/3.8.0-beta1/raw/app/assets/js/ui/atoms/text.js
- Modified: 2022-09-19T16:26:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/elementor/3.8.0-beta1/code/app/assets/js/ui/atoms/text.js#L10-L20`.

```javascript
import { arrayToClassName } from '../../utils/utils';

export default function Text( props ) {
	const baseClassName = 'eps',
		classes = [
			props.className,
		],
		variant = props.variant && 'md' !== props.variant ? '-' + props.variant : '';

	classes.push( baseClassName + '-text' + variant );

	const Element = () => React.createElement( props.tag, {
		className: arrayToClassName( classes ),
	}, props.children );

	return <Element />;
}

Text.propTypes = {
	className: PropTypes.string,
	variant: PropTypes.oneOf( [ 'xl', 'lg', 'md', 'sm', 'xs', 'xxs' ] ),
	tag: PropTypes.string,
	children: PropTypes.any.isRequired,
};

Text.defaultProps = {
	className: '',
	tag: 'p',
};

```
