Get started / Using React

Get started

Using React

react-ecosphere is the same design system for React 18.2 and 19: the same 97 components, the same props and the same markup, styled by the same stylesheet. This page explains how the Vue API you see on other pages maps to React props.

Choose React with the switch at the top of the page and every code sample, API table and import follows. The live demos on this site run on Vue, but each React component renders exactly the same HTML, so what you see is what you get.

The two packages share versions: react-ecosphere 1.1 matches vue-ecosphere 1.1, component for component. Patch releases are independent.

From the Vue API to React

The translation is mechanical, and the API tables on each page already apply it when React is selected.

vue-ecospherereact-ecosphere
v-model="x"value={x} onChange={setX} (the callback receives the value)
v-model:open="open"open={open} onOpenChange={setOpen}
a model that also works unbounddefaultValue / defaultOpen for uncontrolled use
@row-click="fn"onRowClick={fn} (same arguments)
default slotchildren
#footerfooter={<…/>}
#actions="{ item }"renderActions={({ item }) => <…/>}
#cell-name="{ row }"renderCell={{ name: ({ row }) => <…/> }}
class / style / attributesclassName / style / attributes, on the same element
useToast(), useConfirm()the same hooks, with the same options

Models, events and slots

The same field and dialog in both packages. A controlled prop always comes with its change callback; leave both out and pass defaultOpen or defaultValue to let the component keep its own state.

Showing the Vue version. Switch the framework at the top to compare.

Next.js and other server renderers

Every component renders on the server, and the bundle is marked "use client", so you can import components straight into Server Components. Overlays (dialogs, drawers, toasts, menus, tooltips) mount into document.body after hydration.

Refs

Components built on a native control (buttons, links, text, number, email, phone and search fields, textareas, checkboxes, switches, and the date and time pickers) forward their ref to it, so focus and measuring work as they would on the element. The other components take no ref.

Where to find it