apphouse
Version:
Component library for React that uses observable state management and theme-able components.
45 lines (44 loc) • 1.3 kB
TypeScript
import { CSSProperties } from 'glamor';
import React from 'react';
import { ApphouseComponent } from './component.interfaces';
/**
* Interface for styles to be applied to the ToggleThemeButton component
*/
export interface ToggleThemeButtonStyles {
container?: CSSProperties;
label?: CSSProperties;
checkbox?: CSSProperties;
slider?: CSSProperties;
}
/**
* Interface for the ToggleThemeButton component
*/
export interface ToggleThemeButtonProps extends ApphouseComponent<ToggleThemeButtonStyles> {
/**
* The label of the button
* @default 'Toggle theme'
* @example 'Toggle theme'
*/
label?: string;
/**
* The callback function to be executed when the button is clicked.
* If provided, the user will control the theme switching
* @example () => { console.log('clicked') }
*/
onClick?: () => void;
/**
* if true, the theme will be set to dark
* @default false
*/
checked?: boolean;
/**
* if true, the button will be small
* @default false
*/
small?: boolean;
}
/**
* It toggles the light/dark theme default from apphouse.
* If onClick is provided, the user will be responsible for switching the theme
*/
export declare const ToggleThemeButton: React.FC<ToggleThemeButtonProps>;