Start Your Own App

Build Your First Page gave you a finished dashboard as one HTML file. This guide turns it into a real project you can run, change, build and deploy: installed from npm, bundled with Vite, outside the ebrains-ui-ecosystem monorepo.

You need Node.js 20 or later. Building inside the monorepo instead? See Build Inside the Monorepo.

Step 1: Create the project

Using Vue or React? Pick --template vue or --template react and follow the framework notes at the end; the steps are the same.

Step 2: Install the design system

  • @ebrains/components: the web components (<eds-header>, <eds-table>…).
  • @ebrains/assets: the stylesheet, design tokens, layout primitives and fonts.
  • ^3 and ~0.9 take fixes and new components, never a breaking change. See the versioning note.

Step 3: Load the styles and components

Replace src/main.js with:

Vite bundles the stylesheet and its fonts; each component loads the first time its tag appears on the page.

Step 4: Bring in your page

  1. In the tutorial, press Copy HTML on the finished dashboard.
  2. Paste it over index.html.
  3. Delete the stylesheet <link> and the loader <script type="module"> from its <head>: main.js loads both now.
  4. Add main.js just before </body>:

Delete the files Vite created that you don’t need (src/counter.js, src/style.css, public/vite.svg).

Step 5: Run it

Open the address it prints (usually http://localhost:5173). Edit index.html and the page updates as you save.

Step 6: Make it interactive

Behaviour goes in src/main.js. The components report what happens with DOM events and expose methods; for example, open the upload modal and react to the forms:

To change data at runtime, set properties instead of attributes, for example document.querySelector('eds-table').data = rows. See Listen to events and Pass objects, arrays and functions.

Step 7: Build and deploy

dist/ now holds static files: index.html, one CSS and one JS bundle, the fonts, and the components’ lazy-loaded chunks. Serve that folder from any static host or web server.

  • Served from a sub-path (for example https://example.org/workflows/)? Set base: '/workflows/' in vite.config.js.
  • Several pages with client-side routing? Make the server answer unknown paths with index.html.
  • Analytics: the components report to Matomo only if your page runs it. See Analytics and ask for consent first.

Vue or React

The steps are the same; steps 2, 3 and 6 change.

Vue (npm create vite@latest workflows -- --template vue). Use the web components directly in your templates, and mount Vue once they are registered:

React (--template react): the wrapper package works from npm (verified with React 18).

Props are camelCase (pressableUrl), events are on + the event name (onEdsclose, onForm), and a ref gives you the element itself, for methods such as modalRef.current.open().

What’s next