Quick Start
GuideRender your first nexious-library components (a button, an icon, a loading state, and a working form) in a few minutes.
This guide assumes you have installed the package and imported nexious-library/@index.css. Every component is a named export from the package root.
#Your first components
import { Button, Icon, IconButton, Loading } from "nexious-library";
// A primary button
<Button label="Get started" onClick={() => {}} />
// An icon (see the built-in icon list under Icon System)
<Icon icon="heart" label="Like" />
// An icon-only button, always pass a title for accessibility
<IconButton icon={{ icon: "edit" }} title="Edit item" onClick={() => {}} />
// A loading state
<Loading message="Fetching…" />#A working form
The Form component builds its fields from initialValues: each key becomes a field. Add types to change the input, labels for copy, and schema for validation. onSubmit receives the formatted values.
import { Form } from "nexious-library";
<Form
initialValues={{ email: "", plan: "", message: "" }}
types={{ plan: "select", message: "textarea" }}
labels={{ email: "Email", plan: "Plan", message: "Message" }}
dataList={{
plan: [
{ name: "plan", label: "Free", value: "free" },
{ name: "plan", label: "Pro", value: "pro" },
],
}}
schema={{ required: ["email", "plan"] }}
onSubmit={(values) => console.log(values)}
/>