
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@apparts/web-components
Advanced tools
#+TITLE: @apparts/web-components #+DATE: [2021-03-11 Thu] #+AUTHOR: Philipp Uhl
@apparts/web-components gives you some standard web components for forms, inputs and in general. They are lightweight, some are for making the use of Formik easier and more standardized.
General purpose:
Formik specific:
** Button
The button component has all usual button props and these:
** Input
The input component has all usual input props and these:
** ErrorMessage
A styled error message that only renders if the message prop is
given. Props:
** FadeIn
A component that fades it's content in, on render. Props:
** If
Formik specific component. Render children, if some condition is true in the Formik input values. Props:
** IfElse
Formik specific component. Render children, if some condition is true in the Formik input values. Props:
** Row
Formik specific component. Renders inputs in a row that wraps at a specifiable width. Props:
** GlobalError
Formik specific component. Renders an error if any field of the form has an error. Useful, e.g. to display a warning near the submit button that explains, that there is an issue present. Props:
** IfDirty
Formik specific component. Renders it's content, only if the formik form is dirty. Useful, e.g., to display a react-routes prompt when leaving a page, but only if the user has unsaved input. Takes no props.
To prevent the form to be dirty after submitting, you can use this line in your =onSubmit= handler function:
#+BEGIN_SRC js const onSubmit = (fields, actions) => { // do the saving, etc. Then, on success: actions.resetForm({ values: fields }); }; #+END_SRC
** FormikInput
Formik specific component. An input field with an error field and a label.
The FormikInput component has all usual (formik) input props and these:
Import the default style, or create your own style based on the default one.
#+BEGIN_SRC js // The default style: import "@apparts/web-components/style.css"; #+END_SRC
To keep the given style sheet but alter the color scheme, just redefine these CSS variables with your color scheme:
#+BEGIN_SRC css :root { --dark-0: #0c0e0e; --dark-1: #23292a; --dark-2: #394546; --dark-3: #516062; --dark-4: #677b7e;
--bright-0: #d8dedf; --bright-1: #e1e6e6; --bright-2: #eaedee; --bright-3: #f3f5f5; --bright-4: #fcfdfd;
--primary-0: #144a52; --primary-1: #1b636d; --primary-2: #227c88; --primary-3: #2995a3; --primary-4: #30aebe; --primary-5: #41bfcf; --primary-6: #5cc8d6; --primary-7: #77d1dd; --primary-8: #92dae4; --primary-9: #ade3eb;
--secondary-0: #521c14; --secondary-1: #6d251b; --secondary-2: #882e22; --secondary-3: #a33729; --secondary-4: #be4030; --secondary-5: #cf5141; --secondary-6: #d66a5c; --secondary-7: #dd8377; --secondary-8: #e49c92; --secondary-9: #ebb5ad;
--green-0: #145214; --green-1: #248f24; --green-2: #33cc33; --green-3: #70db70; --green-4: #adebad;
--yellow-0: #525214; --yellow-1: #8f8f24; --yellow-2: #cccc33; --yellow-3: #dbdb70; --yellow-4: #ebebad;
--red-0: #521414; --red-1: #8f2424; --red-2: #cc3333; --red-3: #db7070; --red-4: #ebadad; } #+END_SRC
FAQs
Components for web applications
The npm package @apparts/web-components receives a total of 122 weekly downloads. As such, @apparts/web-components popularity was classified as not popular.
We found that @apparts/web-components demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.