@jswork/mantine-form-validators
v1.0.9
Published
Validate rule manager.
Downloads
30
Readme
mantine-form-validators
Validate rule manager.
installation
npm install -S @jswork/mantine-form-validators
usage
- import css
@import "~@jswork/mantine-form-validators/dist/style.css";
// or use sass
@import "~@jswork/mantine-form-validators/dist/style.scss";
// customize your styles:
$mantine-form-validators-options: ()
- import js
import React from 'react';
import MantineFormValidators from '../../src/main';
import styled from 'styled-components';
import { scanVite } from '@jswork/scan-modules';
const Container = styled.div`
width: 80%;
margin: 30px auto 0;
`;
export default () => {
const moduleFiles = import.meta.glob('./shared/rules/**/*.ts', { eager: true });
const modules = scanVite(moduleFiles, { modules: '/rules/' }) as any;
return (
<Container>
<MantineFormValidators modules={modules} />
</Container>
);
};
preview
- https://afeiship.github.io/mantine-form-validators/
license
Code released under the MIT license.