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
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.
| Prop | Type | Default |
|---|---|---|
disabled | boolean | false |
type | "button" | "reset" | "submit" | "submit" |
data-pressed | boolean | false |
CSS variables
| Variable | Purpose |
|---|---|
--ore-launch-button-unit | Base size unit |
--ore-launch-button-face-default | Face color |
--ore-launch-button-face-hover | Face color on hover |
--ore-launch-button-face-pressed | Face color while pressed |
--ore-launch-button-highlight-default | Top highlight color |
--ore-launch-button-highlight-hover | Top highlight color on hover |
--ore-launch-button-highlight-pressed | Top highlight color while pressed |
--ore-launch-button-shade-default | Side and bottom shading, and label shadow color |
--ore-launch-button-shade-hover | Shading color on hover |
--ore-launch-button-shade-pressed | Shading color while pressed |
--ore-launch-button-border | Outline color |
--ore-launch-button-drop-shadow | Drop shadow color |
--ore-launch-button-focus-ring | Focus ring color |
--ore-launch-button-foreground | Label color |
--ore-launch-button-text-shadow | Label shadow offset and color |
--ore-launch-button-font-family | Label font; Cinnangles Ten by default |
--ore-launch-button-font-size | Label size |
--ore-launch-button-text-transform | Label case; uppercase by default |
--ore-launch-button-min-width | Minimum width |
--ore-launch-button-min-height | Minimum height |
--ore-launch-button-padding-inline | Horizontal padding |
--ore-launch-button-depth | How 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.