Gathering detailed insights and metrics for @omegion1npm/amet-consectetur-veritatis
Gathering detailed insights and metrics for @omegion1npm/amet-consectetur-veritatis
npm install @omegion1npm/amet-consectetur-veritatis
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
123
Last Day
1
Last Week
2
Last Month
8
Last Year
123
MIT License
2,578 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Mar 14, 2025
Latest Version
1.0.0
Package Id
@omegion1npm/amet-consectetur-veritatis@1.0.0
Unpacked Size
19.53 kB
Size
7.29 kB
File Count
10
NPM Version
10.5.0
Node Version
20.12.2
Published on
Apr 26, 2024
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
100%
2
Compared to previous week
Last Month
-50%
8
Compared to previous month
Last Year
0%
123
Compared to previous year
25
A customizable, simple loading overlay with spinner and transitions.
v1.x is a rewrite focused on flexibility. Customization is no longer driven by convenience props, but instead by a more comprehensive styles
interface. The intention is to provide an interface that is a bit more tailored to composition and creating your own loader rather than just dropping an instance in place.
Wrap your components in it and toggle the active
prop as necessary.
1import LoadingOverlay from '@omegion1npm/amet-consectetur-veritatis'; 2 3<LoadingOverlay 4 active={isActive} 5 spinner 6 text='Loading your content...' 7 > 8 <p>Some content or children or something.</p> 9</LoadingOverlay>
active
(boolean)
true
- whether the loader is visible.fadeSpeed
(milliseconds)
500
- the transition speed for fading out the overlay.onClick
(function)
undefined
- click handler for the overlay when active.className
(string)
undefined
- the className for the wrapping <div />
that is present whether active or not.classNamePrefix
(string)
_loading_overlay_
- the prefix for all classNames on the generated elements. see Styling for more info.spinner
(boolean OR node)
false
- renders the default spinner when true
(and when the loader is active
). Otherwise you can provide any valid react node to use your own spinner.text
(node)
undefined
- the text or react node to render in the loader overlay when active.styles
(object)
undefined
- see Styling for more info.Adding a custom spinner is super easy, here's an example:
Acquire the spinner you want to use. Doesn't matter where you get it, as long as you're rendering a valid React node. It can be a custom svg in your codebase if you want. For this example let's use react-spinners
.
npm install react-spinners
Then simply provide it to the spinner prop for your loader.
1import LoadingOverlay from '@omegion1npm/amet-consectetur-veritatis' 2import BounceLoader from 'react-spinners/BounceLoader' 3 4export default function MyLoader({ active, children }) { 5 return ( 6 <LoadingOverlay 7 active={active} 8 spinner={<BounceLoader />} 9 > 10 {children} 11 </LoadingOverlay> 12 ) 13}
Previous versions were difficult to customize because of limited configuration props. This iteration uses a form of styling heavily inspired by Style configuration was inspired by react-select
. Internally using emotion
to style elements and providing a styles
interface to either extend the base styling or completely overwrite it. Additionally, a classNamePrefix
prop is available to customize the classNames used on each element, allowing you to define your own styles with your own regular css setup.
Keep reading for details on each option.
The styles prop accepts an object where each key represents one of the following elements:
wrapper
- main wrapping element, always present.overlay
- the overlay positioned over top of the children.content
- element inside the overlay containing the spinner and text.spinner
- default spinner element.Each value must be an object or a function (where the first parameter is the base default styles) that returns an object. In either case, the resulting object will be applied as the final set of styles via emotion.css. See examples below.
1export default function MyLoader({ active, children }) { 2 return ( 3 <LoadingOverlay 4 active={active} 5 styles={{ 6 overlay: (base) => ({ 7 ...base, 8 background: 'rgba(255, 0, 0, 0.5)' 9 }) 10 }} 11 > 12 {children} 13 </LoadingOverlay> 14 ) 15}
1export default function MyLoader({ active, children }) { 2 return ( 3 <LoadingOverlay 4 active={active} 5 styles={{ 6 spinner: (base) => ({ 7 ...base, 8 width: '100px', 9 '& svg circle': { 10 stroke: 'rgba(255, 0, 0, 0.5)' 11 } 12 }) 13 }} 14 > 15 {children} 16 </LoadingOverlay> 17 ) 18}
1export default function MyLoader({ active, children }) { 2 return ( 3 <LoadingOverlay 4 active={active} 5 styles={{ 6 wrapper: { 7 width: '400px', 8 height: '400px', 9 overflow: active ? 'hidden' : 'scroll' 10 } 11 }} 12 > 13 {children} 14 </LoadingOverlay> 15 ) 16}
Every element has a classname you can target via your own css configuration.
_loading_overlay_wrapper
_loading_overlay_overlay
_loading_overlay_content
_loading_overlay_spinner
You can also specify your own classNamePrefix
if you wish. For example, if using: classNamePrefix="MyLoader_"
:
MyLoader_wrapper
MyLoader_overlay
MyLoader_content
MyLoader_spinner
The base styles will still be applied, but you could negate all of these using the styles prop:
1export default function MyLoader({ active, children }) { 2 return ( 3 <LoadingOverlay 4 active={active} 5 styles={{ 6 wrapper: {}, 7 overlay: {}, 8 content: {}, 9 spinner: {} 10 }} 11 classNamePrefix='MyLoader_' 12 > 13 {children} 14 </LoadingOverlay> 15 ) 16}
You can style the loader using styled-component
as you might expect.
Simply include the nested elements in your style definition:
1import styled from 'styled-components' 2 3const StyledLoader = styled(LoadingOverlay)` 4 width: 250px; 5 height: 400px; 6 overflow: scroll; 7 .MyLoader_overlay { 8 background: rgba(255, 0, 0, 0.5); 9 } 10 &.MyLoader_wrapper--active { 11 overflow: hidden; 12 } 13` 14 15export default function MyLoader({ active, children }) { 16 return ( 17 <StyledLoader 18 active={active} 19 classNamePrefix='MyLoader_' 20 > 21 {children} 22 </StyledLoader> 23 ) 24}
No vulnerabilities found.
No security vulnerabilities found.