Bedform UIButtons

Launch Button

The main call to action that starts a game or a world.

Use a launch button for the one action a screen exists for, such as Play. Use Button for every other action.

Launch Button

*
boolean
*
string
*

Usage

import { LaunchButton } from "@bedform/ui/launch-button";

export function App() {
  return <LaunchButton type="button">Play</LaunchButton>;
}

Label

The label is set in Cinnangles Ten at 10 units and upper-cased. At the default 2px unit, each texel of the font covers one whole CSS pixel, so the label stays sharp. To change the font or keep the label's case, override the variables:

.my-launch-button {
  --ore-launch-button-font-family: var(--ore-font-label);
  --ore-launch-button-text-transform: none;
}

Width

The button is at least 120 units wide and grows with its label. Set width to fill a column:

<LaunchButton type="button" style={{ width: "100%" }}>
  Play
</LaunchButton>

Pressed

While it is held, the face sinks two units into its drop shadow. Set data-pressed to keep it lowered, for example while the game starts.

<LaunchButton type="button" data-pressed={starting || undefined}>
  Play
</LaunchButton>

Disabled

<LaunchButton type="button" disabled>
  Play
</LaunchButton>

API

LaunchButton renders a native button and accepts every button attribute, event and form behavior. It forwards its ref to the button.

PropTypeDefault
disabledbooleanfalse
type"button" | "reset" | "submit""submit"
data-pressedbooleanfalse

CSS variables

VariablePurpose
--ore-launch-button-unitBase size unit
--ore-launch-button-face-defaultFace color
--ore-launch-button-face-hoverFace color on hover
--ore-launch-button-face-pressedFace color while pressed
--ore-launch-button-highlight-defaultTop highlight color
--ore-launch-button-highlight-hoverTop highlight color on hover
--ore-launch-button-highlight-pressedTop highlight color while pressed
--ore-launch-button-shade-defaultSide and bottom shading, and label shadow color
--ore-launch-button-shade-hoverShading color on hover
--ore-launch-button-shade-pressedShading color while pressed
--ore-launch-button-borderOutline color
--ore-launch-button-drop-shadowDrop shadow color
--ore-launch-button-focus-ringFocus ring color
--ore-launch-button-foregroundLabel color
--ore-launch-button-text-shadowLabel shadow offset and color
--ore-launch-button-font-familyLabel font; Cinnangles Ten by default
--ore-launch-button-font-sizeLabel size
--ore-launch-button-text-transformLabel case; uppercase by default
--ore-launch-button-min-widthMinimum width
--ore-launch-button-min-heightMinimum height
--ore-launch-button-padding-inlineHorizontal padding
--ore-launch-button-depthHow far the face sinks when pressed

Accessibility

The visible label is the accessible name. Because the label is upper-cased with CSS, screen readers read the text as written in the markup.

On this page