# Gameface UI Update: Menu Glow-Up + Quick Component Customization Guide

> In the newest version of Gameface UI, the default Menu got a glow-up and now showcases our newest components. Here's what changed and how to tailor the look/behavior to your UI.

> Documentation index: https://coherent-labs.com/llms.txt lists every page of this documentation as Markdown; the full text is in https://coherent-labs.com/llms-full.txt.

Source: https://coherent-labs.com/blog/uitutorials/gamefaceui-menu-glow-up/

## Gameface UI Update: Menu Glow-Up + Quick Component Customization Guide

ui tutorials

8/28/2025

Martin Bozhilov

1. What’s new in the Menu
2. Component Customization
3. Slider
   1. Step 1 — Creating the wrapper
   2. Step 2 — Styling
   3. Step 3 — Making it functional
   4. Step 4 — Making it reusable
4. Segment
   1. Using TypeScript for Autocomplete

In the latest update [**GameFace UI** ](https://gameface-ui.coherent-labs.com/)ships a refreshed Menu UI that highlights our newest components out of the box.

## What’s new in the Menu

The new UI for the menu view now showcases the following components:

- [Scroll ](https://gameface-ui.coherent-labs.com/components/layout/scroll)- The scroll component is great for display long menu options lists while preserving a defined structured, without overflow.
- [Tabs ](https://gameface-ui.coherent-labs.com/components/layout/tabs/)- The tabs component is perfect for organizing content into separate views, making it easy for users to navigate between different sections of the menu.
- [Modal ](https://gameface-ui.coherent-labs.com/components/basic/modal/)- The modal component is used for displaying important information or actions that require user attention, such as confirming changes before navigating away from a tab.
- [Segment ](https://gameface-ui.coherent-labs.com/components/basic/segment/)- The segment component is ideal for selecting between multiple options in a compact and visually appealing way, such as choosing keybind presets.
- [Dropdown ](https://gameface-ui.coherent-labs.com/components/basic/dropdown/)- The dropdown component is useful for selecting from a list of options without taking up too much space in the UI, such as selecting resolution, graphics quality or a language.
- [Stepper ](https://gameface-ui.coherent-labs.com/components/basic/stepper/)- The stepper component is great for incrementing or decrementing values in a controlled manner, such as adjusting the difficulty level of a game.
- [ToggleButton ](https://gameface-ui.coherent-labs.com/components/basic/toggle-button/)- The toggle button component is perfect for enabling or disabling settings with a simple switch, such as turning on/off fullscreen mode or VSync.
- [Slider ](https://gameface-ui.coherent-labs.com/components/basic/slider/)- The slider component is ideal for selecting a value within a range, such as adjusting mouse sensitivity or field of view.
- [TextSlider ](https://gameface-ui.coherent-labs.com/components/basic/text-slider/)- The text slider component is useful for selecting from a list of predefined options in a visually appealing way, in our case we used it for subtitle size selection.
- [NumberInput ](https://gameface-ui.coherent-labs.com/components/basic/number-input/)- The number input component is great for entering numerical values directly, such as setting a custom frame rate limit.
- [Checkbox ](https://gameface-ui.coherent-labs.com/components/basic/checkbox/)- The checkbox component is perfect for toggling options such as enabling/disabling various accessibility features.
- [List ](https://gameface-ui.coherent-labs.com/components/layout/list/)- The list component is useful for displaying a list of items in a structured manner. It has a wide veriety of use cases, in our case we used it to display additional information about the settings and on the end credits.
- [ColorPicker ](https://gameface-ui.coherent-labs.com/components/complex/color-picker/)- The color picker component is ideal for selecting colors in a user-friendly way, such as customizing the crosshair color.

The complete Menu UI is located at `src/views/menu/Menu.tsx` in your Gameface UI project. To preview it, run `npm run dev` and open the Player at `localhost:3000/menu`.

All components in the menu have been styled to match the new UI. You’ll find these customized components in `src/custom-components/Menu/`. Next, let’s explore how some of these components were tailored and how their features help create an interactive menu experience!

## Component Customization

Since most components will be reused across the UI, it’s better to wrap them into custom components. This allows you to centralize styling, define common behavior, and keep consistency.

## Slider

Let’s walk through how to take the base Slider and adapt it for our minimalistic design.

### Step 1 — Creating the wrapper

We’ll start by creating `CustomSlider` in `custom-components/CustomSlider/CustomSlider.tsx.` The idea: place the slider value next to the slider using `Flex` for layout.

```tsx
import Slider from "@components/Basic/Slider/Slider"
import Block from "@components/Layout/Block/Block";
import Flex from "@components/Layout/Flex/Flex";

const CustomSlider = () => {
    return (
        <Flex align-items="center">
            <Block>{3}</Block>
            <Slider
                step={0.1}
                min={1}
                max={10}
                value={3}
            />
        </Flex>
    )
}

export default CustomSlider;
```

### Step 2 — Styling

Next, define the component’s slot we will modify and wire them up for styling with classes.

```tsx
import Slider from "@components/Basic/Slider/Slider"
import Block from "@components/Layout/Block/Block";
import Flex from "@components/Layout/Flex/Flex";
import style from './CustomSlider.module.scss';

const CustomSlider = () => {
    return (
        <Flex align-items="center" class={style.wrapper}>
            <Block class={style['value-preview']}>{3}</Block>
            <Slider
                step={0.1}
                min={1}
                max={10}
                value={3}
                class={style.slider}>
                    <Slider.Handle class={style['slider-handle']}></Slider.Handle>
                    <Slider.Fill class={style['slider-fill']}></Slider.Fill>
                    <Slider.Track class={style['slider-track']}></Slider.Track>
            </Slider>
        </Flex>
    )
}

export default CustomSlider;
```

With the classes wired up, we will now add some CSS to create our desired look. The changes we will make to the component are simple: new colors, hover state, removing the rounding and hiding the handle.

```scss
.wrapper {
    width: 15vmax;
}

.value-preview {
    border: 0.2vh solid $primaryColor;
    width: 2.5vmax;
    padding: 0.5vmax 0;
    margin-right: 2vmax;
    text-align: center;
}

.slider {
    margin: 0;
    width: 10vmax;
    height: 1vmax;

    &-handle {
        visibility: hidden;
        padding: 1vmax;
    }

    &-track {
        background-color: $background-soft;
    }

    &-track,
    &-fill {
        border-radius: 0;
    }

    &-track {
        background-color: $background-soft;

        &:hover {
            background-color: $background-soft-hover;
        }
    }
}
```

**Tip:** use `visibility: hidden` instead of `display: none` for the handle. Otherwise, the slider won’t register drag/click events.

**Tip:** Add some padding to the hidden element to increace its area - making it easier to click and interact with.

With these changes our slider shoud look like this:

### Step 3 — Making it functional

The final step is to make our slider interactive by binding its value to the `Block` component that displays it.

The process is straightforward and already covered in detail in [our documentation ](https://gameface-ui.coherent-labs.com/components/basic/slider/#retrieve-and-use-the-slider-value).

In short, we need to:

1. Create a signal to store the current slider value.
2. Pass a callback to the slider’s `onChange` prop.
3. Update the signal inside that callback so the `Block` always shows the latest value.

This setup ensures the UI is reactive - whenever the slider moves, the displayed value updates instantly.

```tsx
import Slider from "@components/Basic/Slider/Slider"
import Block from "@components/Layout/Block/Block";
import Flex from "@components/Layout/Flex/Flex";
import style from './CustomSlider.module.scss';
import { createSignal } from "solid-js";
import { emitChange } from "../../../views/menu/util";

const CustomSlider = () => {
    const [value, setValue] = createSignal(3);
    const handleChange = (newValue: number) => {
        setValue(newValue)
        emitChange()
    }

    return (
        <Flex align-items="center" class={style.wrapper}>
            <Block class={style['value-preview']}>{value()}</Block>
            <Slider
                onChange={handleChange}
                step={0.1}
                min={1}
                max={10}
                value={value()}
                class={style.slider}>
                    <Slider.Handle class={style['slider-handle']}></Slider.Handle>
                    <Slider.Fill class={style['slider-fill']}></Slider.Fill>
                    <Slider.Track class={style['slider-track']}></Slider.Track>
            </Slider>
        </Flex>
    )
}

export default CustomSlider;
```

The benefit of having a handler passed to the `onChange` is that we can run additional logic when the value changes. In our case we need to call a `emitChange` function which will just let us know if changes have been made to the UI (we use it to display a modal when the tab is about to change).

### Step 4 — Making it reusable

If you plan to use the component just once in your UI you can leave it like that and hard-code the values but in our case we need this slider in a lot of places across the UI. To achieve reusability we will add `props` to the `CustomSlider` which will need to be passed when it is initialized.

```tsx
import Slider from "@components/Basic/Slider/Slider"
import Block from "@components/Layout/Block/Block";
import Flex from "@components/Layout/Flex/Flex";
import style from './CustomSlider.module.scss';
import { createSignal } from "solid-js";
import { emitChange } from "../../../views/menu/util";

interface CustomSliderProps {
    step: number;
    min: number;
    max: number;
    value: number;
    onChange?: (value: number) => void;
}

const CustomSlider = (props: CustomSliderProps) => {
    const [value, setValue] = createSignal(props.value);
    const handleChange = (newValue: number) => {
        setValue(newValue)
        emitChange()
    }

    return (
        <Flex align-items="center" class={style.wrapper}>
            <Block class={style['value-preview']}>{value()}</Block>
            <Slider
                onChange={handleChange}
                step={props.step}
                min={props.min}
                max={props.max}
                value={value()}
                class={style.slider}>
                    <Slider.Handle class={style['slider-handle']}></Slider.Handle>
                    <Slider.Fill class={style['slider-fill']}></Slider.Fill>
                    <Slider.Track class={style['slider-track']}></Slider.Track>
            </Slider>
        </Flex>
    )
}

export default CustomSlider;
```

With this setup our custom slider can be modified however we see fit for the UI. This is how the `CustomSlider` will need to be initialized:

```tsx
<MenuItem id="fov" name='Field of view'>
    <CustomSlider min={1} max={10} step={0.1} value={3.5} />
</MenuItem>
<MenuItem id="mouseSensitivity" name='Mouse sensitivity'>
    <CustomSlider step={0.1} min={1} max={10} value={3.3} />
</MenuItem>
```


## Segment

The process of customizing the `Segment` component follows the same principle as with the `Slider`: wrap the base component, style its slots, and extend it with props to make it reusable.

Here’s a simplified `CustomSegment` implementation:

```tsx
import Segment from "@components/Basic/Segment/Segment"
import { For } from "solid-js";
import style from './CustomSegment.module.scss';
import { emitChange } from "../../../views/menu/util";

type CustomSegmentProps<V extends readonly string[]> = {
    values: V;
    default: V[number];
    'custom-class'?: string;
    onChange?: (v: V[number]) => void;
    ref?: any;
};

export function CustomSegment<V extends readonly string[]>(props: CustomSegmentProps<V>) {
    const handleChange = (val: V[number]) => {
        emitChange()
        props.onChange?.(val);
    };

    return (
        <Segment ref={props.ref} onChange={handleChange} class={`${style.segment} ${props["custom-class"] ?? null}`} >
            <For each={props.values}>
                {(v) => <Segment.Button
                    class={style['segment-button']}
                    class-selected={style['segment-button-selected']}
                    selected={v === props.default}
                    value={v}>{v}</Segment.Button>}
            </For>
            <Segment.Indicator class={style['segment-indicator']} />
        </Segment>
    )
}

export default CustomSegment;
```

The component styling:

```scss
.segment {
    background-color: $background-soft;
    width: 20vmax;

    &-button {
        flex: 1;
        justify-content: center;
        background-color: transparent;
        color: $disabledColor;
        text-transform: capitalize;

        &:hover {
            color: $textColor;
            background-color: $background-soft-hover;
        }

        &-selected {
            color: $textColor;

            &:hover {
                background-color: transparent;
            }
        }
    }

    &-button::before {
        box-shadow: none !important;
    }

    &-button::after {
        background-color: $background-soft;
    }
}
```

### Using TypeScript for Autocomplete

Notice how we have made our `CustomSegment` component is defined as a [generic function ](https://www.typescriptlang.org/docs/handbook/2/generics.html):

```ts
export function CustomSegment<V extends readonly string[]>(props: CustomSegmentProps<V>) {
```

This lets us combine **generics + tuple types** to make the component fully type-safe and autocomplete-friendly.

By declaring the values prop as a `readonly string[]`, TypeScript can infer valid options for you. The only requirement is to declare your options with the `as const` assertion:

```tsx
const OPTIONS = ['PC', 'Tactical', 'Left-Handed', 'Custom'] as const;

<MenuItem id="keybindPreset" name="Keybind Preset">
    <CustomSegment
        ref={segmentRef}
        values={OPTIONS}
        default="PC"
        onChange={(v) => setPreset(PRESETS[v])}
    />
</MenuItem>
```

Now, `onChange` will only accept `"PC" | "Tactical" | "Left-Handed" | "Custom"` — preventing typos and giving you IDE autocomplete for free.

## On this page
