CraftUI

Server Browser

Servers you can search and filter by favorites, with the chosen server's details and a big Play button.

Play

Servers (4)

  • Minigames with friends, parties and more.12,737 of 20,000 playersExcellent ping, 38 ms
  • Build anything on a shared island.214 of 500 playersFair ping, 210 ms
  • Survive the night together.96 of 300 playersConnecting
  • Back soon after maintenance.Offline
Excellent ping, 38 ms12,737 of 20,000 players

Gemfall

Minigames with friends, parties and more.

Open on a page of its own

Follows Ore UI's Servers tab: the list on one side and the chosen server on the other.

Installation

npx shadcn@latest add @runqora/craft-server-browser

Usage

import { ServerBrowser } from "@/components/craft/blocks/server-browser";

<ServerBrowser
  onAddServer={openAddServer}
  onFavoriteChange={(server, favorite) => setFavorite(server.id, favorite)}
  onJoin={(server) => join(server.id)}
  servers={servers}
/>;

Props

ServerBrowser

Prop

Type

Accessibility

  • Each server's name is a button that shows its details, marked as the current one.
  • The details are a region named after the server, and Play is named after it too, such as "Play Gemfall". It's disabled while connecting or offline.
  • The search box and Favorites only switch are labelled.

Customization

The block keeps only what's on screen, such as the search text. Your data comes in through props, and every action calls one of your handlers, so it works with any backend. On a narrow screen, the details sit under the list. Every screen fills its frame, so give it a height, such as h-dvh for a whole page.

Dependencies

  • craft-button, craft-input, craft-screen, craft-server-list and craft-switch
  • shadcn's utils, and craft-theme

Source