Bedform UI

Getting Started

Add OreUI to your React application.

Install

pnpm add @bedform/ui

@bedform/ui needs React 19 and React DOM 19 as peer dependencies.

Styles

Every component imports the stylesheet and its fonts itself, so there is nothing to import. Your bundler (such as Vite, webpack or Next.js) includes them as soon as you use a component.

To style plain elements with the public ore-* classes before any component is used, import the stylesheet once:

import "@bedform/ui/styles.css";

Use a component

App.tsx
import { Button } from "@bedform/ui/button";

export function App() {
  return <Button type="button">Create new world</Button>;
}

Each component has its own entry, such as @bedform/ui/button. To import every component from one place, use @bedform/ui.

Typed events

Components that dispatch custom events type their handlers:

GameMode.tsx
import { Button } from "@bedform/ui/button";
import { Dropdown } from "@bedform/ui/dropdown";

export function GameMode() {
  return (
    <Dropdown onChange={(event) => console.log(event.detail.value)}>
      <Button className="ore-dropdown-trigger" type="button">
        Game mode
      </Button>
      <div className="ore-dropdown-menu">
        <button className="ore-dropdown-item" type="button" data-value="survival">
          Survival
        </button>
      </div>
    </Dropdown>
  );
}

The components forward children, className, native properties, ARIA attributes and refs.

The components only support client rendering. Render them from client components, such as files marked "use client" in Next.js.

On this page