Skip to main content

Components

Image

The Image component can be used together with the type: image schema field.

Example

import React from 'react';
import { registerVevComponent, Image } from '@vev/react';

const MyComponent = (props) => {
return (
<Image src={props.image} />
);
};

registerVevComponent(MyComponent, {
name: "My component",
props: [{
name: "image",
type: "image",
}]
})

export default MyComponent;

Interface

ImageProps {
className?: string;
sizes?: [number, number][];
src?: string | { key: string };
style?: { [attr: string]: number | string };
}

The Link component can be used together with the type: link schema field.

Example

import React from 'react';
import { registerVevComponent, Link } from '@vev/react';

const MyComponent = (props) => {
return (
<Link to={props.link} />
);
};

registerVevComponent(MyComponent, {
name: "My component",
props: [{
name: "link",
type: "link",
}]
})

export default MyComponent;

Interface

LinkProps {
/**
* Preset for what linkType the field should be.
* 0: Page, 1: Element, 2: External link, 3: Email, 4: Phone.
*/
mode: 0 | 2 | 3 | 4;
href?: string;
page?: string;
target?: boolean;
phone?: string;
email?: string;
}