Vistaprint

Choosing Your API

We provide two ways to consume Visage:

  • the underlying vanilla API, or

  • the React API.

The vanilla API provides patterns of HTML tags, plus CSS stylesheets that style the classes used in that HTML. For components that need JavaScript functionality, there are also static script files whose JavaScript looks for those same CSS classes and adds the necessary behavior.

The React API provides easy-to-use React components that output the same patterns of HTML tags and CSS classes, and use the same stylesheets. Any JavaScript functionality is instead implemented natively in React, so that the React components can act as controlled components.

Both APIs use the same HTML tags and CSS classes for the same component, and the same set of static stylesheets. We use semvar for versioning, so we won't introduce any breaking or backwards-incompatible changes to either API except in major-version changes (and with sufficient advance notice).

Both APIs offer the same set of components, with rare exception: some components are built using third-party React libraries, so those components are only available in React. However, this is a small list, currently just Carousel, Listbox, and Combobox.

The two APIs also have different ways of doing the initial page setup. For instance, the React API provides a VisageProvider component, and some React components to wrap the major sections of the page. The vanilla API just provides a list of the necessary HTML tags instead.