Collection of theme-ui and external components.
Theme UI
created:3/15/2021
updated:3/15/2021
source lines:48
comments %:13

Source

Syntax highliting source code component. Uses prism for the actual source display.

Overview

export const sample = () => {
const [state, setState] = React.useState(false);
return (
<BooleanEditor
name="prop"
onChange={(name, newVal) => setState(newVal)}
prop={{ type: ControlTypes.BOOLEAN, value: state }}
/>
);
};

Name
Description
Default
Controls
children

source code to be displayed.

string | (string & {}) | (string & ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)>) | (new (props: any) => Component<...>)>) | (string & ReactNodeArray) | (string & ReactPortal)
language

source lnguage used, by default "jsx".

markupbashclikeccppcssjavascriptjsxcoffeescriptactionscriptcss-extrdiffgitgographqlhandlebarsjsonlessmakefilemarkdownobjectivecocamlpythonreasonsassscsssqlstylustsxtypescriptwasmyaml
-
dark

used to specify a "dark" color theme - applcable only if no custom theme prop is provided. if dark: true, duotoneDark theme is used. if dark: false, duotoneLight theme is used.

boolean
-

A11y tests

export const sample = () => {
const [state, setState] = React.useState(false);
return (
<BooleanEditor
name="prop"
onChange={(name, newVal) => setState(newVal)}
prop={{ type: ControlTypes.BOOLEAN, value: state }}
/>
);
};

Viewport

export const sample = () => {
const [state, setState] = React.useState(false);
return (
<BooleanEditor
name="prop"
onChange={(name, newVal) => setState(newVal)}
prop={{ type: ControlTypes.BOOLEAN, value: state }}
/>
);
};
320px

export const sample = () => {
const [state, setState] = React.useState(false);
return (
<BooleanEditor
name="prop"
onChange={(name, newVal) => setState(newVal)}
prop={{ type: ControlTypes.BOOLEAN, value: state }}
/>
);
};
375px

export const sample = () => {
const [state, setState] = React.useState(false);
return (
<BooleanEditor
name="prop"
onChange={(name, newVal) => setState(newVal)}
prop={{ type: ControlTypes.BOOLEAN, value: state }}
/>
);
};
768px

export const sample = () => {
const [state, setState] = React.useState(false);
return (
<BooleanEditor
name="prop"
onChange={(name, newVal) => setState(newVal)}
prop={{ type: ControlTypes.BOOLEAN, value: state }}
/>
);
};
1024px