PluginProbe
Parse.ly / 3.24.2
Parse.ly v3.24.2
3.24.3 3.24.2 3.24.1 3.24.0 3.23.7 3.23.6 3.23.5 3.23.4 3.23.3 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.17.0 3.18.0 3.18.1 3.19.0 3.19.1 3.19.2 3.19.3 3.2.0 3.2.1 3.20.0 3.20.1 All 107 releases
wp-parsely / src / content-helper / common / components / vertical-divider / component.tsx

component.tsx in Parse.ly 3.24.2, at src/content-helper/common/components/vertical-divider/component.tsx

36 lines 963 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * WordPress dependencies
3 */
4 import { Rect, SVG } from '@wordpress/components';
5
6 /**
7 * Props structure for VerticalDivider.
8 *
9 * @since 3.19.0
10 */
11 interface VerticalDividerProps {
12 size?: number;
13 color?: string;
14 }
15
16 /**
17 * Returns a vertical divider component.
18 *
19 * @since 3.14.0
20 * @since 3.16.0 Moved from `RelatedPostItem` and `TitleSuggestion`.
21 * @since 3.19.0 Added size prop.
22 * @since 3.20.0 Added color prop.
23 *
24 * @param {VerticalDividerProps} props The component's props.
25 *
26 * @return {import('react').JSX.Element} The vertical divider component.
27 */
28 export const VerticalDivider = ( { size = 40, color = '#cccccc' }: VerticalDividerProps ): JSX.Element => {
29 return <>
30 { /* Use 3px width instead of 1px to ensure the divider is visible on all browsers. */ }
31 <SVG xmlns="http://www.w3.org/2000/svg" width="3" height={ size } viewBox={ `0 0 1 ${ size }` } fill="none">
32 <Rect width="1" height={ size } fill={ color } />
33 </SVG>
34 </>;
35 };
36