ColorScheme
A JSX email component which provides meta and style foundations for color scheme support
Install
Install the component from your command line
pnpm add jsx-emailbun add jsx-emailnpm add jsx-emailyarn add jsx-emailUsage
import { Body, ColorScheme, Head, Html } from 'jsx-email';
const Email = () => { return ( <Html> <Head> <ColorScheme mode="light only" /> </Head> <Body></Body> </Html> );};Props
TypeScript Interface
export interface ColorSchemeProps { mode?: Mode;}Optional Props
mode
mode?: ColorSchemeMode;Selects the color scheme mode. Defaults to 'normal'.
Available modes:
'dark'- Dark mode'dark only'- Forces dark mode only'light'- Light mode'light dark'- Adapts to user preference'light dark only'- Forces adaptation to user preference'light only'- Forces light mode only'normal'- Uses page defaults or no specific scheme