formio / pretty-checkbox

Adding pretty-checkbox plugin to Form.io forms

Home Page:https://formio.github.io/pretty-checkbox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Form.io Pretty Checkboxes

This is a Form.io renderer module that adds the Pretty Checkbox styles to all rendered checkboxes.

Installation

To install this module, just type the following.

npm install --save @formio/pretty-checkbox

Adding to your renderer.

To enable this for all rendered forms in your application, do the following.

import { Formio } from 'formiojs';
import FormioPrettyCheckbox from '@formio/pretty-checkbox';
Formio.use(FormioPrettyCheckbox);

You will also need to add the styles like so.

@import '~@formio/pretty-checkbox/dist/formio-pretty-checkboxes.css';

Extending

You can also use the class to create your own extended Checkbox classes that use the Pretty Checkbox.

import { Formio } from 'formiojs';
import FormioPrettyCheckbox from '@formio/pretty-checkbox';
Formio.use(FormioPrettyCheckbox);

const PrettyCheckbox = FormioPrettyCheckbox.components.checkbox;

export default class CustomCheckbox extends PrettyCheckbox {}

About

Adding pretty-checkbox plugin to Form.io forms

https://formio.github.io/pretty-checkbox


Languages

Language:JavaScript 63.0%Language:TypeScript 23.6%Language:EJS 8.6%Language:HTML 4.3%Language:SCSS 0.5%