Skip to main content

fast-checkbox

An implementation of a checkbox as a form-connected web-component.

Setup#

Basic Setup#

import {    provideFASTDesignSystem,    fastCheckbox} from "@microsoft/fast-components";
provideFASTDesignSystem()    .register(        fastCheckbox()    );

Customizing Indicators#

import {    provideFASTDesignSystem,    fastCheckbox} from "@microsoft/fast-components";
provideFASTDesignSystem()    .register(        fastCheckbox({            checkedIndicator: `...your checked indicator...`,            indeterminateIndicator: `...your indeterminate indicator...`,        })    );

Usage#

Live Editor
Result
SyntaxError: Unexpected token (1:8)
1 : return ()
            ^

Create your own design#

import {    Checkbox,    CheckboxOptions,    checkboxTemplate as template,} from "@microsoft/fast-foundation";import { checkboxStyles as styles } from "./my-checkbox.styles";
export const myCheckbox = Checkbox.compose<CheckboxOptions>({    baseName: "checkbox",    template,    styles,    checkedIndicator: `...default checked indicator...`,    indeterminateIndicator: `...default indeterminate indicator...`,});

Additional resources#