mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-23 03:18:48 +02:00
Initial commit
This commit is contained in:
46
src/deck-components/Controls.tsx
Normal file
46
src/deck-components/Controls.tsx
Normal file
@@ -0,0 +1,46 @@
|
||||
import { FC, VFC } from 'react';
|
||||
|
||||
import { ControlsModule } from '../modules';
|
||||
|
||||
interface ButtonProps {
|
||||
label?: string;
|
||||
description?: string;
|
||||
layout?: 'below';
|
||||
onClick?(): void;
|
||||
disabled?: boolean;
|
||||
bottomSeparator?: boolean;
|
||||
}
|
||||
|
||||
export const Button: FC<ButtonProps> = ControlsModule.a;
|
||||
|
||||
interface SwitchProps {
|
||||
label?: string;
|
||||
description?: string;
|
||||
checked: boolean;
|
||||
icon?: JSX.Element;
|
||||
disabled?: boolean;
|
||||
onChange?(checked: boolean): void;
|
||||
}
|
||||
|
||||
export const Switch: VFC<SwitchProps> = ControlsModule.j;
|
||||
|
||||
interface NotchLabel {
|
||||
notchIndex: number;
|
||||
label: string;
|
||||
value: number;
|
||||
}
|
||||
|
||||
interface SliderProps {
|
||||
label?: string;
|
||||
value: number;
|
||||
layout?: 'below';
|
||||
icon?: JSX.Element;
|
||||
min?: number;
|
||||
max?: number;
|
||||
step?: number;
|
||||
notchCount?: number;
|
||||
notchLabels?: NotchLabel[];
|
||||
onChange?(value: number): void;
|
||||
}
|
||||
|
||||
export const Slider: VFC<SliderProps> = ControlsModule.l;
|
||||
Reference in New Issue
Block a user