Card Title...
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut...
npm i xerum
or yarn add xerum
Then destructure the component in the file using import — example:
import { Button } from 'xerum';
Note: Unless noted otherwise, you can pass standard attributes as you would with any element or React component — for example: disabled, target, style, className etc.
Name:
sectionsDescription:
Array of objects that describes each section. Objects must include { title, content } keys. An optional color key with valid hex formatting can be included to quickly color the entire section.Default:
—Name:
openDefaultDescription:
Deafult section to expand on load.Default:
—Name:
openIconDescription:
Font Awesome i.e. "fa-solid fa-minus".Default:
Name:
closeIconDescription:
Font Awesome i.e. "fa-solid fa-plus".Default:
Name:
noIconDescription:
Removes the open and close section icons.Default:
—Name:
callbackDescription:
Generic function to run when the active section changes. Receives new section.Default:
—.yourClassName {}
.yourClassName .section {}
.yourClassName .section .title {}
.yourClassName .section .title:hover {}
.yourClassName .section .title.active {}
.yourClassName .section .title.active:hover {}
.yourClassName .section .title i {}
.yourClassName .section .content {}
<Accordion />
container by default.const sections = [
{
title: "First section",
content: "Section 1 content",
},
{
title: "Second section",
content: "Section 2 content",
},
{
title: "Third section",
content: "Section 3 content",
},
];
<Accordion
sections={sections}
openDefault={sections[0]}
/>
Name:
imageDescription:
Thumbnail image to render on card.Default:
—Name:
titleDescription:
Title text to display on card.Default:
—Name:
titleColorDescription:
Sets the color of the title text using hex format, i.e. #000 or #000000.Default:
Name:
textDescription:
Preview text to display on card.Default:
—Name:
limitDescription:
Limits the length of the preview text by character -- will stop at the nearest whole word closest to given character limit.Default:
96Name:
footerDescription:
Enables the card footer for additional information. Takes a string or element.Default:
trueName:
urlDescription:
External url to open if image or title is clicked.Default:
—Name:
verticalDescription:
Changes the default horizontal layout of the Card to vertical.Default:
—.yourClassName {}
.yourClassName .image {}
.yourClassName .text .title {}
.yourClassName .footer {}
<Card />
container by default.Horizontal:
Card Title...
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut...
Vertical:
Card Title...
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut...
<Card
image="your-thumb-url.[ext]"
title="Card Title..."
text={yourPreviewText}
limit={96}
footer="Image credit: iStock Photo"
url="https://google.com"
vertical
/>
Name:
titleDescription:
Title to display in confirm dialogue.Default:
—Name:
titleColorDescription:
Sets the color of the title text using hex format, i.e. #000 or #000000.Default:
—Name:
messageDescription:
Primary message to display in confirm dialogue.Default:
—Name:
confirmTextDescription:
Text to display on the confirm button.Default:
OkayName:
cancelTextDescription:
Text to display on the cancel button.Default:
CancelName:
onConfirmDescription:
Generic event handler when confirm button is clicked. This should not toggle state visibility and is reserved only for your API call or other action.Default:
—Name:
onCancelDescription:
Generic event handler when cancel button is clicked. This should toggle state visibility.Default:
—Name:
bgCloseDescription:
Allows click event on the confirm background to trigger the onCancel handler.Default:
false.yourClassName {}
.yourClassName .title {}
.yourClassName .message {}
.yourClassName .confirm button {}
.yourClassName .cancel button {}
<Confirm />
container by default.const [ visible, setVisible ] = useState(false);
(visible && (
<Confirm
title="Confirm Title..."
message="You have asked the user to respond."
onConfirm={yourAPICall}
onCancel={() => setVisible(!visible)}
bgClose
/>
)}
Name:
titleDescription:
Title to display in the Modal window.Default:
—Name:
titleColorDescription:
Sets the color of the title text and close icon hover state using hex format, i.e. #000 or #000000.Default:
—Name:
closeIconDescription:
Font Awesome i.e. "fa-solid fa-xmark".Default:
Name:
onCloseDescription:
Generic event handler when close button is clicked — your state action for controlling visibility should be passed here.Default:
—Name:
bgCloseDescription:
Allows click event on the modal background to trigger the onClose handler.Default:
falseconst [ visible, setVisible ] = useState(false);
{visible && (
<Modal
title="Modal title..."
onClose={() => setVisible(!visible)}
bgClose
>
<p>Modal content...</p>
</Modal>
)}
Name:
titleDescription:
Title to display in the Slide-Over panel.Default:
—Name:
titleColorDescription:
Sets the color of the title text and close icon hover state using hex format, i.e. #000 or #000000.Default:
—Name:
closeIconDescription:
Font Awesome i.e. "fa-solid fa-arrow-right-long".Default:
Name:
onCloseDescription:
Generic event handler when close button is clicked — your state action for controlling visibility should be passed here.Default:
—const [ visible, setVisible ] = useState(false);
{visible && (
<SlideOver
title="Slide-Over title..."
onClose={() => setVisible(!visible)}
>
<p>Slide-Over content...</p>
</SlideOver>
)}
Name:
content*Description:
Object description of headers and rows.Default:
—Name:
sortableDescription:
Enables headers to sort table by ascending/descending column results when clicked — receives newly sorted array.Default:
—Name:
defaultSortDescription:
Default column to sort — must be an existing header string from your headers array.Default:
headers[0]Name:
draggableDescription:
Enables manual sort order manipulation of table rows via drag and drop — receives newly sorted array.Default:
—Name:
dragIconDescription:
Font Awesome i.e. "fa-solid fa-grip-vertical".Default:
Name:
labelColorDescription:
Sets the color of the label text using hex format, i.e. #000 or #000000.Default:
Name:
labelBGDescription:
Sets the color of the label background using hex format, i.e. #000 or #000000.Default:
Name:
columnLayoutDescription:
Overrides dynamically created, evenly spaced, columns with grid-based formatting i.e. "10rem 1fr 7rem" or "repeat(3, 1fr)".Default:
-*Required Prop.
Note: Add an onClick function to your row object;rows: [{ ...tData, onClick }]
or a label key/value for labels; rows: [{ ...tData, label }]
— ideal labels are under six characters.Tip: You can target the following CSS heirarchy for custom styling: .yourClassName {}
.yourClassName .header {}
.yourClassName li {}
<Table />
container by default.Bird Name:
RavenFlight Speed Mph:
50Bird Name:
Golden EagleFlight Speed Mph:
200Bird Name:
SparrowFlight Speed Mph:
—const [ content, setContent ] = useState({
headers: [ "Bird Name", "Flight Speed (MPH)" ],
rows: [
{
td1: "Sparrow",
td2: null,
onClick: () => rowHandler("Sparrow"),
label: "Small",
},
{
td1: "Golden Eagle",
td2: 200,
onClick: () => rowHandler("Eagle"),
label: "Large",
},
{
td1: "Raven",
td2: 50,
onClick: () => rowHandler("Raven"),
label: "Medium",
},
],
});
const flightSpeed = content.headers[1];
const receivedArr = sortedArr => {
// Normalize or send to state directly.
setContent({ ...content, rows: sortedArr })
};
<Table
content={content}
defaultSort={flightSpeed}
sortable={receivedArr}
draggable={receivedArr}
/>
Name:
content*Description:
Array of objects containing { name, content } keys, where name is the friendly name shown on the tab and content is the content to be rendered.Default:
—Name:
activeColorDescription:
Sets the color of the active tab background using hex format, i.e. #000 or #000000.Default:
Name:
inactiveColorDescription:
Sets the color of the inactive tab background using hex format, i.e. #000 or #000000.Default:
*Required prop.
Tip: You can target the following CSS heirarchy for custom styling:.yourClassName {}
.yourClassName .tabNames {}
.yourClassName .tabNames .name {}
.yourClassName .tabNames .name.active {}
.yourClassName .tabSlider {}
<Tabs />
container by default.const content = [
{ name: "Tab 1", content: "Content 1" },
{ name: "Tab 2", content: "Content 2" },
{ name: "Tab 3", content: "Content 3" },
];
<Tabs content={content} />
Name:
textDescription:
Text to show on label — overrides children.Default:
—Name:
colorDescription:
Sets the color of the label text using hex format, i.e. #000 or #000000.Default:
Name:
bgColorDescription:
Sets the background color of the label using hex format, i.e. #000 or #000000.Default:
Name:
useCloseDescription:
Enabled label close icon.Default:
—Name:
closeIconDescription:
Font Awesome i.e. "fa-solid fa-circle-xmark".Default:
Name:
callbackDescription:
Generic click handler for controlling label removal when useClose is true.Default:
—.yourClassName {}
.yourClassName i.labelClose {}
<Label />
container by default.const white = #ffffff;
const blue = #0d97ff;
<Label>
<i className="fa-solid fa-child" />
child...
</Label>
<Label text="Removable"
useClose
callback={() => console.log("Closed")}
/>
<Label text="Custom"
useClose
closeIcon="fa-solid fa-xmark"
color={white}
bgColor={blue}
/>
Name:
currentDescription:
Current value to divide with.Default:
—Name:
totalDescription:
Total value to divide by.Default:
—Name:
limitDescription:
Limits the decimal placement count.Default:
2Name:
usePlusDescription:
true or false. Enables the "+" symbol preceding positive percent values.Default:
falseName:
positiveColorDescription:
Sets the color of a positive result using hex format, i.e. #000 or #000000.Default:
—Name:
negativeColorDescription:
Sets the color of a negative result using hex format, i.e. #000 or #000000.Default:
—const blue = "#0d97ff";
<Percent
current={3483.432}
total={60}
positiveColor={blue}
usePlus
/>
Name:
valueDescription:
Amount to be rendered.Default:
0Name:
limitDescription:
Limits the decimal placement count.Default:
2Name:
symbolDescription:
Symbol of currency that precedes value. Takes a string or more custom solution within React tags.Default:
$Name:
currencyDescription:
Three to four letter abbreviated currency, i.e. USD, GBP, YUAN etc.Default:
—Name:
positiveColorDescription:
Sets the positive color of value using hex format, i.e. #000 or #000000.",Default:
—Name:
negativeColorDescription:
Sets the negative color of value using hex format, i.e. #000 or #000000.",Default:
—const blue = "#0d97ff";
<Price
value={1024.76623496782}
symbol={
<Fragment>
<i className="fa-brands fa-ethereum" />
</Fragment>
}
currency="ETH"
limit={8}
positiveColor={blue}
/>
Name:
currentDescription:
Current value to divide with.Default:
—Name:
totalDescription:
Total value to divide by.Default:
—Name:
fixedPctDescription:
Keeps percent value fixed instead of following the progress bar.Default:
falseName:
noPctDescription:
Disables percent value.Default:
falseName:
colorDescription:
Sets the color of the progress bar using hex format, i.e. #000 or #000000.Default:
Name:
bgColorDescription:
Sets the color of the progress track using hex format, i.e. #000 or #000000.Default:
Name:
pctColorDescription:
Sets the color of the percent value using hex format, i.e. #000 or #000000.Default:
.yourClassName {}
.yourClassName .progress .pct {}
<Progress />
container by default.<Progress
current={4354.432}
total={7200}
pctColor="#ffffff"
/>
Name:
countDescription:
Integer count to be displayed — will not display if falsey.Default:
—Name:
squareDescription:
Overrides default circle styling with rounded square corners.Default:
—<Badge />
component works well when placed as a child insde the <Button />
component. You are also free to place it on any component you please — the important thing is that a custom className or style prop with position data should be passed to get proper placement. The associated examples use the following CSS:.pos {
top: -2.55rem;
right: -1.55rem;
}
// Default
<Button icon="fa-solid fa-bell">
<Badge className="pos" count={4} />
</Button>
// Square
<Button icon="fa-solid fa-envelope">
<Badge className="pos" count={1296} square />
</Button>
Name:
textDescription:
Text to show on banner — overrides children.Default:
—Name:
closeIconDescription:
Font Awesome i.e. "fa-solid fa-times".Default:
Name:
noCloseDescription:
Disables banner close icon.Default:
—Name:
callbackDescription:
Generic click handler, typically for controlling banner state.Default:
—Name:
centerDescription:
Center justifies banner text or children.Default:
—Name:
roundDescription:
Overrides default corner styling with round corners.Default:
—<Banner />
component will take up all of the available width in its parent container by default.const icon = "fa-solid fa-triangle-exclamation";
<Banner
center
round
noClose
className="customBanner"
callback={handleClose}
>
<i className={icon} />
<strong>Reminder</strong>:
Servers will be down.
</Banner>
Name:
name*Description:
Name of field to validate — must match reference field name, exactly.Default:
—*Required Prop.
Note: The<FieldError />
component uses Formik for field state management and should be used within Formik's <Form />
tag. The associated example shows a proper Formik setup with yup handling validation rules.import Formik from 'formik';
import * as yup from 'yup';
const defaults = { email: "" };
const schema = yup.object().shape({
email: yup
.string()
.email('Invalid email.')
.required('Field is required.')
.trim(),
});
const handleSubmit = args => {
const { values, setSubmitting } = args;
// Your submit action from state...
};
<Formik
initialValues={defaults}
validationSchema={schema}
enableReinitialization={true}
onSubmit={(values, { setSubmitting }) => {
handleSubmit({ values, setSubmitting });
}}>
{form => (
<Form>
<Field type="text" name="email" />
<FieldError name="email" />
<Button type="submit" />
</Form>
)}
</Formik>
Name:
value*Description:
Current value of the associated field to check against.Default:
—Name:
upperDescription:
Adds an uppercase requirement.Default:
—Name:
lowerDescription:
Adds a lowercase requirement.Default:
—Name:
numberDescription:
Adds a number requirement.Default:
—Name:
minDescription:
Adds a minimum length requirement.Default:
8Name:
specialDescription:
Adds a special character requirement — pass a custom string to override default.Default:
@#$%^&+=!Name:
excludeDescription:
Array of objects for custom exclusion. Objects must be { display, value }. Where display is the friendly name shown and value is the exclusion.Default:
—Name:
colorDescription:
Sets the active color of a valid icon using hex format, i.e. #000 or #000000.Default:
#0d97ffName:
exColorDescription:
Sets the active color of an exclusion icon using hex format, i.e. #000 or #000000.Default:
#c93434Name:
bgColorDescription:
Sets the inactive color of all icons using hex format, i.e. #000 or #000000.Default:
#aab2b8*Required Prop.
Note: The<FieldReqs />
component is not responsible for field validation on submit — it is simply visual feedback so the user can correct any validation issues prior to submitting.const [ inputVal, setInputVal ] = useState("");
const fName = "Bob";
const lName = "Belcher";
<input
type="password"
placeholder="Type password to test..."
onChange={e => {
setInputVal(e.currentTarget.value);
}}
/>
<FieldReqs
value={inputVal}
upper
lower
number
min
special
exclude={[
{ display: "First name", value: fName },
{ display: "Last name", value: lName },
]}
/>
Name:
isLoading*Description:
true or false — derived from loading selector managed in app state on specific resource API call start/end.Default:
trueName:
hasData*Description:
true or false — derived from data returned (or not) after server response.Default:
falseName:
iconDescription:
Font Awesome i.e. "fa-solid fa-spinner".Default:
Name:
textDescription:
Your text or component to display while API call is being made.Default:
Loading...Name:
failIconDescription:
Font Awesome i.e. "fa-solid fa-exclamation-circle".Default:
Name:
failTextDescription:
Your text or component to display if loading/API call is complete and no data was returned or set in app state.Default:
Load failed.Name:
noIconDescription:
Disables load/fail icons.Default:
—Name:
noTextDescription:
Disables load/fail text.Default:
—*Required prop.
Tip: You can get creative by disabling the icon and passing your own component as the text — such as the<Progress />
component — or try passing a style attribute and change the color of the loader based on isLoading and hasData.Load ready
Fail ready
// General use
<Loading
isLoading={contentLoading}
hasData={contentData}
>
{/*
Your content after loading has finished
and 200 response data set in app state.
*/}
<i className="fa-solid fa-thumbs-up" />
All good.
</Loading>
Name:
iconDescription:
Font Awesome i.e. "fa-solid fa-bug".Default:
Name:
noIconDescription:
Disabled not found icon.Default:
—Name:
titleDescription:
Sets a custom, heavily-weighted title.Default:
404: Hrmm...Name:
noTitleDescription:
Disables not found title.Default:
—Name:
messageDescription:
Sets a custom message.Default:
Can't find that page.Name:
noMessageDescription:
Disables not found message.Default:
—.yourClassName {}
.yourClassName h2 {}
.yourClassName p {}
<NotFound />
container by default.Can't find that page.
<NotFound />
Name:
notifications*Description:
Array of notifications. Array values must be a string or an object with the following keys: { message, type, icon } all string values, with icon being Font Awesome — type must be success, warning or error.Default:
—Name:
removeNotification*Description:
Action from app state responsible for removing a notification from state — receives the index to remove.Default:
—Name:
timeDescription:
Time (milleseconds) before notification self-closes.Default:
4 secondsName:
noTimeDescription:
Disables self-closing timer, user must manually close notification.Default:
—Name:
noIconsDescription:
Disables notification icons.Default:
—*Required prop.
Note: You will first need to have an existing notifications array selector and corresponding addNotification action set up in app state. Then, at the root of your app, place<Notifications />
with that action/selector pair passed in the props.Now any component event or API callback that triggers your addNotification action will trigger notifications.
const newNotification = "You've been notified!";
// 1. Ready action/selector array in app state.
const [ notifications, setNotifications ] = useState([]);
const addNotification = notification => {
setNotifications([ ...notifications, notification ]);
};
const removeNotification = index => {
const updatedArray = notifications.filter((item, i) => {
if (index !== i) return item;
};
setNotifications(updatedArray);
};
// 2. Place Notifications component
// in root component and pass the
// notifications array action/selector.
<Notifications
time={3000}
notifications={notifications}
removeNotification={removeNotification}
/>
// 3. Trigger notification action from any
// component event or API callback.
<Button
text="Click to Notify"
callback={() => addNotification(newNotification)}
/>
Name:
name*Description:
Name of field, for validation.Default:
—Name:
labelDescription:
String to display to the right of the checkbox.Default:
—Name:
iconDescription:
Font Awesome i.e. "fa-solid fa-check".Default:
Name:
boxColorDescription:
Sets the color of the check box using hex format, i.e. #000 or #000000.Default:
Name:
checkColorDescription:
Sets the color of the check mark using hex format, i.e. #000 or #000000.Default:
*Required Prop.
Note: The<Checkbox />
component uses Formik for field state management and should be used within Formik's <Form />
tag. The associated example shows a proper Formik setup with yup handling validation rules.Tip: You can target the following CSS heirarchy for custom styling: .yourClassName {}
.yourClassName .markContainer .box {}
.yourClassName .markContainer .check {}
<Checkbox />
container by default.import Formik from 'formik';
import * as yup from 'yup';
const defaults = { sampleCheckbox: false };
const schema = yup.object().shape({
sampleCheckbox: yup
.bool()
.oneOf([true], 'Field is required.')
});
const handleSubmit = args => {
const { values, setSubmitting, resetForm } = args;
// Your submit action from state...
};
<Formik
initialValues={defaults}
validationSchema={schema}
enableReinitialization={true}
onSubmit={(values, { setSubmitting, resetForm }) => {
const args = { values, setSubmitting, resetForm };
handleSubmit(args);
}}>
{form => (
<Form>
<Checkbox
name="sampleCheckbox"
label="I agree to the Terms."
/>
<div>
<FieldError name="sampleCheckbox" />
</div>
<Button type="submit" />
</Form>
)}
</Formik>
Name:
iconDescription:
Font Awesome i.e. "fa-solid fa-circle".Default:
Name:
iconColorDescription:
Sets the color of the toggle icon using hex format, i.e. #000 or #000000.Default:
Name:
inactiveColorDescription:
Sets the inactive color of the toggle track using hex format, i.e. #000 or #000000.Default:
Name:
activeColorDescription:
Sets the active color of the toggle track using hex format, i.e. #000 or #000000.Default:
Name:
callbackDescription:
Generic handler that receives new toggle value of true or false.Default:
—.yourClassName {}
.yourClassName input {}
.yourClassName .toggleTrack {}
.yourClassName .toggleTrack i {}
<Toggle />
container by default.<Toggle />
Name:
name*Description:
Your name, company/organization etc. the copyright belongs to.Default:
—Name:
tradeDescription:
Displays a registered trademark symbol in addition to the copyright.Default:
—Name:
rightsDescription:
Displays an additional message with your copyright.Default:
All rights reserved.<Copyright name="Your Name" />
<Copyright name="Company, LLC" rights trade />
<Copyright
name="Organization"
rights="made with love."
/>
Name:
networks*Description:
Array of objects with name, path and icon keys.Default:
icon:Name:
noTextDescription:
Disables network name text, if it exists.Default:
—Name:
columnDescription:
Stacks network icon and name.Default:
—Name:
asTooltipDescription:
Displays network name as a tool tip on icon hover.Default:
—Name:
tipPositionDescription:
top, right, bottom or left.Default:
Lower-right of cursor.*Required prop.
Note: Not including or leaving an empty name key in your networks array object will also have the same effect as passing the noText prop. Though asTooltip and noText may look the same, noText will not render the name of the network on hover.
Tip: You can target the following CSS heirarchy for custom styling:.yourClassName {}
.yourClassName a {}
.yourClassName a i {}
.yourClassName .tooltip {}
<Social />
container by default.const socialNetworks = [
{
name: "Twitter",
path: "https://twitter.com",
icon: "fa-brands fa-twitter" },
{
name: "Facebook",
path: "https://facebook.com",
icon: "fa-brands fa-facebook" },
{
name: "Instagram",
path: "https://instagram.com",
icon: "fa-brands fa-instagram"
},
];
<Social
asTooltip
tipPosition="top"
networks={socialNetworks}
/>
<Social networks={socialNetworks} />
<Social networks={socialNetworks} column />
Name:
iconDescription:
Font Awesome i.e. "fa-solid fa-info-circle".Default:
Name:
textDescription:
Text to show on hover — overrides children.Default:
—Name:
positionDescription:
top, right, bottom or left.Default:
Lower-right of cursor..yourClassName {}
.yourClassName .tip {}
.yourClassName i {}
<Tooltip />
container by default.// Standard
<Tooltip text="Standard tool tip." />
// Child
<Tooltip position="top">
<i className="fa-solid fa-smile" />
Tool tip rendering children.
</Tooltip>
Name:
iconDescription:
Font Awesome i.e. "fa-solid fa-filter".Default:
Name:
noIconDescription:
Removes the filter field icon.Default:
—Name:
dataDescription:
Main data object with at least one { key: value } pair.Default:
—Name:
includeDescription:
Array of key names from your data object to include in filter results — use dot notation to access nested keys, i.e. "key.subKey.anotherKey"Default:
—Name:
callbackDescription:
Generic handler that receives filtered array results.Default:
—<Search />
component, the <Filter />
component filters existing DOM elements in real-time — it does not use any external API callbacks.Tip: The <Filter />
component allows for powerful filtering. You can type in partial words, numbers, a single letter or multiple words in the same field to see all query results at once.When accessing an array of objects, keep the dot notation going to drill into the final key you want to use as a filter value. It is assumed that all objects in your array of objects have identical structure — see associated example.
Results (9):
// 1. Set hook to receive filtered data.
const [ filtered, setFiltered ] = useState([]);
const data = {
stableCoin: "USDC",
currencies: {
pairs: [ "USD", "GBP", "EUR" ],
crypto: [
{ rawData: { symbol: "BTC" } },
{ rawData: { symbol: "ETH" } },
{ rawData: { symbol: "XRP" } },
{ rawData: { symbol: "ADA" } },
{ rawData: { symbol: "DOT" } },
],
},
};
<Filter
data={data}
placeholder="Partial or multiple words..."
include={[
"stableCoin",
"currencies.pairs",
"currencies.crypto.rawData.symbol",
]}
// 2. set filtered data to use for
// conditional rendering...
callback={newData => setFiltered(newData)}
/>
Name:
iconDescription:
Font Awesome i.e. "fa-solid fa-magnifying-glass".Default:
Name:
noIconDescription:
Removes the search field icon.Default:
—Name:
noButtonDescription:
Removes the search field submit button. Submit can be triggered with the "Enter" key.Default:
—Name:
btnTextDescription:
Text to display on search button.Default:
SearchName:
btnClassNameDescription:
Your className string to forward to the button element.Default:
—Name:
callbackDescription:
Generic event handler when search button is clicked.Default:
—.yourClassName {}
.yourClassName form {}
.yourClassName form label {}
.yourClassName form label i {}
.yourClassName form label input {}
.yourClassName form button {}
<Search />
container by default.<Search
btnText="Find it"
placeholder="Find something..."
callback={val => {
const payload = { yourQueryKey: val };
// Your API action...
sendToAPI(payload);
}} />
Name:
timeframeDescription:
seconds, minutes, hours, days, weeks or months.Default:
hoursName:
aggregateDescription:
Aggregation for timeframe, i.e. new time range interval every 3rd day in the week or 15m in the hour etc.Default:
1Name:
localDescription:
Overrides UTC and uses local time.Default:
UTCName:
limitDescription:
Limits display length. i.e. limit of 3 for months as MM:WW:DD vs MM:WW:DD:hh:mm:ssDefault:
—Name:
compactDescription:
Removes friendly units and compresses space between time spots, i.e. 00:00:00Default:
—Name:
callbackDescription:
Function to execute when timer reaches the end of it's range.Default:
—Timeframe: Months (12 months/year)
Aggregate: Every 3 months (4 total)
From: Wed, 1/1/2025, 12:00:00 AM
To: Thu, 1/1/2026, 12:00:00 AM
UTC: true
Start: Tue, 7/1/2025, 12:00:00 AM
Now: Tue, 9/2/2025, 08:21:06 AM
End: Wed, 10/1/2025, 12:00:00 AM
<AggTimer timeframe="months" aggregate={3} />
Name:
authDescription:
true or false.Default:
—Name:
redirectDescription:
Path of authentication page to redirect to if token is invalid.Default:
/login<AuthRoute />
should be placed in React Router's element prop, with the actual <Route />
you are protecting as a child component. Please see the code sample as well as React Router's docs for details regarding proper <Route />
usage.Note: The value of the auth prop should come from the result of your token validation process in app state.
User will see auth. route only.
(Sample auth form below)
<Routes>
<Route element={<AuthRoute auth={token} />}>
<Route path="/" element={<Content />} />
</Route>
</Routes>
Name:
timeDescription:
Time (milleseconds) between connection tests.Default:
60 secondsName:
iconDescription:
Font Awesome i.e. "fa-solid fa-ethernet".Default:
Name:
textDescription:
Text to display on connection fail.Default:
No connection detected.Name:
disabledDescription:
true or false.Default:
—Tip: It is recommended to pass your NODE_ENV flag/conditional to the disabled prop.
Note: This component will not render to the DOM until the internet connection goes out — your main<App />
is rendered by default. You may need to wait, at most, 60 seconds before the change happens since that is the default interval.Online: Rendering Dev. App...
(no connection checks)
... or disable your N.I.C. for the real deal.
import process from 'process';
const { env: { NODE_ENV } } = process;
const dev = NODE_ENV !== "production";
// Wrap your main App with Heartbeat.
<Heartbeat disabled={dev}>
<App />
</Heartbeat>
Name:
colorDescription:
Sets the color of the indicator using hex format, i.e. #000 or #000000.Default:
Name:
textDescription:
Text to display next to service indicator.Default:
—Note: The examples provided are hard-coded for clarity, but should receive their colors, dynamically, from app state.
const green = "#50b990";
const yellow = "#f0b800";
const red = "#c93434";
<Status color={green} text="App servers" />
<Status color={yellow} text="Media servers" />
<Status color={red} text="Email sending" />
Name:
iconDescription:
Font Awesome i.e. "fa-solid fa-angle-up".Default:
Name:
iconColorDescription:
Sets the color of the icon using hex format, i.e. #000 or #000000.Default:
Name:
bgColorDescription:
Sets the color of the background using hex format, i.e. #000 or #000000.Default:
.yourClassName {}
.yourClassName i {}
<ToTop />
container by default.<ToTop
icon="fa-solid fa-angles-up"
/>