Ninna UI v0.6.0 - Full Component API Source Reference This document contains the unminified TypeScript Implementation and Styling layer of all Ninna UI components (v0.6.0). It is explicitly designed for LLMs to read and instantly understand the current API boundaries, DOM structures, and prop-types of the design system. IMPORTANT: Each component is exported from exactly ONE package. Import from the package shown next to each component below. Use version 0.6.0 or later — install with @latest (e.g. pnpm add @ninna-ui/core@latest). Do NOT use 0.1.0. ## Component API Quick Reference (auto-generated) Exact import + props for every documented component. Always import from the package shown. ====================================================== @ninna-ui/primitives ====================================================== ### Avatar import { Avatar } from "@ninna-ui/primitives"; Avatar props: - src: string — Image source URL for the avatar - alt: string — Alternative text for the image - name: string — Name used to generate initials fallback (e.g., 'John Doe' → 'JD') - size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' [default: 'md'] — Size of the avatar - shape: 'circle' | 'square' [default: 'circle'] — Shape of the avatar - radius: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full' [default: 'md'] — Border radius when shape is 'square' - color: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' [default: 'neutral'] — Color theme for fallback background - showRing: boolean [default: false] — Show a colored ring around the avatar - ringColor: Color — Ring color (defaults to color prop) - fallback: React.ReactNode — Custom fallback content when image fails or no src - showFallbackIcon: boolean [default: false] — Show fallback icon instead of initials - loading: 'eager' | 'lazy' [default: 'lazy'] — Image loading attribute - className: string — Additional CSS classes Avatar Group props: - max: number — Maximum number of avatars to show before overflow indicator - size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' [default: 'md'] — Size for all avatars in the group - spacing: 'tight' | 'normal' | 'loose' [default: 'normal'] — Spacing between avatars (overlap amount) - children (required): React.ReactNode — Avatar components to display in the group - className: string — Additional CSS classes Example: ```tsx import { Avatar , Code } from "@ninna-ui/primitives"; export default function Example() { return ( ); } ``` ### Badge import { Badge } from "@ninna-ui/primitives"; Badge props: - variant: 'solid' | 'soft' | 'outline' [default: 'soft'] — Visual style variant of the badge - color: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' [default: 'primary'] — Color theme of the badge - size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' [default: 'md'] — Size of the badge - radius: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full' [default: 'md'] — Border radius style - className: string — Additional CSS classes - children: React.ReactNode — Content to display inside the badge Example: ```tsx import { Badge } from "@ninna-ui/primitives"; export default function Example() { return ( New ); } ``` ### Blockquote import { Blockquote } from "@ninna-ui/primitives"; Blockquote props: - color: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' [default: 'primary'] — Color variant of the blockquote - variant: 'outline' | 'solid' | 'soft' [default: 'outline'] — Visual style variant - cite: string — URL of the citation source (for the cite attribute) - citeSource: ReactNode — Citation author/source to display - showIcon: boolean [default: false] — Whether to show a quote icon - icon: ReactNode — Custom quote icon - className: string — Additional CSS classes Example: ```tsx import { Blockquote } from "@ninna-ui/primitives"; export default function Example() { return (
The only way to do great work is to love what you do.
); } ``` ### Button import { Button } from "@ninna-ui/primitives"; Button props: - variant: 'solid' | 'soft' | 'outline' | 'ghost' | 'text' [default: 'solid'] — Visual style variant of the button - color: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' [default: 'primary'] — Color theme of the button - size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' [default: 'md'] — Size of the button - radius: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full' [default: 'md'] — Border radius of the button - loading: boolean [default: false] — Shows loading spinner and disables the button - disabled: boolean [default: false] — Disables the button - fullWidth: boolean [default: false] — Makes the button full width - leftIcon: React.ReactNode — Icon to display on the left side - rightIcon: React.ReactNode — Icon to display on the right side - className: string — Additional CSS classes - children (required): React.ReactNode — Button content Example: ```tsx import { Button } from "@ninna-ui/primitives"; export default function Example() { return ( ); } ``` ### Code import { Code } from "@ninna-ui/primitives"; Code props: - color: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' [default: 'neutral'] — Color variant of the code - size: 'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' [default: 'sm'] — Text size of the code - className: string — Additional CSS classes Example: ```tsx import { Code } from "@ninna-ui/primitives"; export default function Example() { return (

Run npm install to install dependencies.

); } ``` ### Divider import { Divider } from "@ninna-ui/primitives"; Example: ```tsx import { Divider , Code } from "@ninna-ui/primitives"; export default function Example() { return (
); } ``` ### Heading import { Heading } from "@ninna-ui/primitives"; Heading props: - as: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' [default: 'h2'] — The heading level - determines the semantic HTML element - size: 'xs' | 'sm' | 'md' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' — Override the default size for the heading level - weight: 'light' | 'normal' | 'medium' | 'semibold' | 'bold' — Font weight override - color: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' [default: 'neutral'] — Text color - align: 'left' | 'center' | 'right' — Text alignment - truncate: boolean [default: false] — Whether to truncate text with ellipsis - lineClamp: 1 | 2 | 3 | 4 | 5 | 6 — Maximum number of lines before truncating - noWrap: boolean [default: false] — Whether text should not wrap - className: string — Additional CSS classes Example: ```tsx import { Heading } from "@ninna-ui/primitives"; export default function Example() { return ( Page Title ); } ``` ### IconButton import { IconButton } from "@ninna-ui/primitives"; Icon Button props: - icon (required): React.ReactNode — The icon to display in the button - aria-label (required): string — Accessible label for the button (required for screen readers) - variant: 'solid' | 'soft' | 'outline' | 'ghost' | 'text' [default: 'solid'] — Visual style variant of the button - color: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' [default: 'primary'] — Color theme of the button - size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' [default: 'md'] — Size of the button (square dimensions) - radius: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full' [default: 'md'] — Border radius of the button - loading: boolean [default: false] — Shows loading spinner and disables the button - disabled: boolean [default: false] — Disables the button - className: string — Additional CSS classes Example: ```tsx import { IconButton } from "@ninna-ui/primitives"; import { Heart } from "lucide-react"; export default function Example() { return ( } color="primary" aria-label="Like" /> ); } ``` ### Kbd import { Kbd } from "@ninna-ui/primitives"; Kbd props: - color: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' [default: 'neutral'] — Color variant - size: 'xs' | 'sm' | 'md' | 'lg' [default: 'sm'] — Size variant - className: string — Additional CSS classes Example: ```tsx import { Kbd } from "@ninna-ui/primitives"; export default function Example() { return (
+ C
); } ``` ### Link import { Link } from "@ninna-ui/primitives"; Link props: - href: string — The URL the link points to - size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' — Text size - matches Text component sizes. Inherits from parent when not set. - color: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' [default: 'neutral'] — Color variant of the link - underline: 'always' | 'hover' | 'none' [default: 'hover'] — Underline behavior - external: boolean [default: false] — Whether the link opens in a new tab (adds target="_blank" and rel="noopener noreferrer") - showExternalIcon: boolean [default: true] — Whether to show an external link icon for external links - externalIcon: ReactNode — Custom external icon to display - className: string — Additional CSS classes Example: ```tsx import { Link } from "@ninna-ui/primitives"; export default function Example() { return ( About Us ); } ``` ### LinkOverlay import { LinkOverlay } from "@ninna-ui/primitives"; Link Box props: - as: 'div' | 'article' | 'section' | 'aside' | 'header' | 'footer' | 'main' | 'nav' [default: 'div'] — The HTML element to render as - className: string — Additional CSS classes Link Overlay props: - href: string — The URL the link points to - external: boolean [default: false] — Whether the link opens in a new tab - className: string — Additional CSS classes Example: ```tsx import { LinkOverlay, LinkBox, Heading, Text } from "@ninna-ui/primitives"; export default function Example() { return ( Article Title Article description... ); } ``` ### List import { List } from "@ninna-ui/primitives"; List props: - type: 'unordered' | 'ordered' [default: 'unordered'] — List type (ul or ol) - spacing: 'none' | 'sm' | 'md' | 'lg' [default: 'sm'] — Spacing between list items - marker: 'disc' | 'circle' | 'square' | 'decimal' | 'alpha' | 'roman' | 'none' | 'check' | 'arrow' [default: 'disc' (unordered) / 'decimal' (ordered)] — Marker style - markerColor: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' [default: 'neutral'] — Marker color - icon: ReactNode — Custom icon for all list items - className: string — Additional CSS classes List Item props: - icon: ReactNode — Custom icon for this item (overrides list icon) - iconColor: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' — Icon color for this item - className: string — Additional CSS classes Example: ```tsx import { List, ListItem } from "@ninna-ui/primitives"; export default function Example() { return ( First item Second item Third item ); } ``` ### Mark import { Mark } from "@ninna-ui/primitives"; Mark props: - color: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' [default: 'neutral'] — Color variant for the highlight - className: string — Additional CSS classes Example: ```tsx import { Mark, Text } from "@ninna-ui/primitives"; export default function Example() { return ( This is some text with highlighted content in the middle. ); } ``` ### Text import { Text } from "@ninna-ui/primitives"; Text props: - as: 'p' | 'span' | 'div' | 'label' | 'strong' | 'em' | 'small' | 'mark' | 'del' | 'ins' | 'sub' | 'sup' [default: 'p'] — The HTML element to render - size: 'xs' | 'sm' | 'md' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' [default: 'md'] — Text size - weight: 'light' | 'normal' | 'medium' | 'semibold' | 'bold' — Font weight - color: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' [default: 'neutral'] — Text color - align: 'left' | 'center' | 'right' | 'justify' — Text alignment - truncate: boolean [default: false] — Whether to truncate text with ellipsis - lineClamp: 1 | 2 | 3 | 4 | 5 | 6 — Maximum number of lines before truncating - muted: boolean [default: false] — Whether to use muted/secondary text color - noWrap: boolean [default: false] — Whether text should not wrap - uppercase: boolean [default: false] — Transform text to uppercase - lowercase: boolean [default: false] — Transform text to lowercase - capitalize: boolean [default: false] — Capitalize text - italic: boolean [default: false] — Apply italic style - underline: boolean [default: false] — Apply underline decoration - strikethrough: boolean [default: false] — Apply line-through decoration - className: string — Additional CSS classes Example: ```tsx import { Text } from "@ninna-ui/primitives"; export default function Example() { return ( Hello, World! ); } ``` ====================================================== @ninna-ui/feedback ====================================================== ### Alert import { Alert } from "@ninna-ui/feedback"; Alert props: - variant: 'solid' | 'soft' | 'outline' [default: 'soft'] — Visual style variant of the alert - color: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' [default: 'neutral'] — Color theme of the alert - title: ReactNode — Alert title text - description: ReactNode — Alert description/message text - icon: ReactNode — Custom icon to display - showIcon: boolean [default: true] — Whether to show the default icon based on color - dismissible: boolean [default: false] — Whether the alert can be dismissed - onDismiss: () => void — Callback when alert is dismissed - action: ReactNode — Action element (button, link, etc.) - size: 'sm' | 'md' | 'lg' [default: 'md'] — Size of the alert - role: string [default: 'alert'] — ARIA role - use 'status' for non-critical messages - children: ReactNode — Alert content (alternative to description) - className: string — Additional CSS classes Example: ```tsx import { Alert } from "@ninna-ui/feedback"; export default function Example() { return ( ); } ``` ### Circular Progress import { CircularProgress } from "@ninna-ui/feedback"; Circular Progress props: - value: number [default: 0] — Current progress value (0 to max) - max: number [default: 100] — Maximum value for the progress - size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' [default: 'md'] — Size of the circular progress - color: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' [default: 'primary'] — Color theme of the progress indicator - strokeWidth: number — Custom stroke width (overrides size default) - showValue: boolean [default: false] — Whether to show the value label - labelPosition: 'center' | 'bottom' | 'none' [default: 'center'] — Position of the value label - formatLabel: (value: number, max: number) => ReactNode — Custom format function for the value label - indeterminate: boolean [default: false] — Whether the progress is indeterminate (loading state) - label: string — Accessible label for screen readers - children: ReactNode — Custom content to render inside the circle - className: string — Additional CSS classes for the container Example: ```tsx import { CircularProgress } from "@ninna-ui/feedback"; export default function Example() { return (
); } ``` ### EmptyState import { EmptyState } from "@ninna-ui/feedback"; Empty State props: - title (required): string — Title text to display - description: string — Description text below the title - icon: React.ReactNode — Icon to display above the title - size: 'sm' | 'md' | 'lg' [default: 'md'] — Size of the empty state - action: React.ReactNode — Action button or content below the description - children: React.ReactNode — Additional content below the description - className: string — Additional CSS classes Example: ```tsx import { EmptyState } from "@ninna-ui/feedback"; import { Button } from "@ninna-ui/primitives"; function SearchIcon(props) { return ( ); } export default function Example() { return ( } title="No results found" description="Try adjusting your search or filters." action={} /> ); } ``` ### Loading import { Loading } from "@ninna-ui/feedback"; Loading props: - variant: 'spin' | 'ping' | 'pulse' | 'dots' [default: 'spin'] — Animation style of the loading indicator - color: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' [default: 'primary'] — Color theme of the loading indicator - size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' [default: 'md'] — Size of the loading indicator - className: string — Additional CSS classes - label: string [default: 'Loading...'] — Accessible label for screen readers Example: ```tsx import { Loading } from "@ninna-ui/feedback"; export default function Example() { return (
); } ``` ### Progress import { Progress } from "@ninna-ui/feedback"; Progress props: - value: number [default: 0] — Current progress value (0 to max) - max: number [default: 100] — Maximum value for the progress - size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' [default: 'md'] — Size of the progress bar - color: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' [default: 'primary'] — Color theme of the progress bar - variant: 'default' | 'striped' | 'animated' [default: 'default'] — Visual style variant - showValue: boolean [default: false] — Whether to show the value label - labelPosition: 'left' | 'right' | 'top' | 'inside' | 'none' [default: 'right'] — Position of the value label - formatLabel: (value: number, max: number) => ReactNode — Custom format function for the value label - indeterminate: boolean [default: false] — Whether the progress is indeterminate (loading state) - label: string — Accessible label for screen readers - className: string — Additional CSS classes for the container - trackClassName: string — Additional CSS classes for the track (background) - indicatorClassName: string — Additional CSS classes for the indicator (filled part) Example: ```tsx import { Progress } from "@ninna-ui/feedback"; export default function Example() { return (
); } ``` ### Skeleton import { Skeleton } from "@ninna-ui/feedback"; Skeleton props: - variant: 'pulse' | 'shine' | 'none' [default: 'pulse'] — Animation variant for the skeleton - width: string | number — Width of the skeleton (e.g., '200px', 200, '100%') - height: string | number — Height of the skeleton (e.g., '20px', 20) - radius: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full' [default: 'md'] — Border radius of the skeleton - loading: boolean [default: true] — Whether the skeleton is in loading state - children: React.ReactNode — Content to show when loading is false - className: string — Additional CSS classes Skeleton Circle props: - size: string | number [default: '40px'] — Size of the circle (width and height) - variant: 'pulse' | 'shine' | 'none' [default: 'pulse'] — Animation variant - loading: boolean [default: true] — Whether the skeleton is in loading state - children: React.ReactNode — Content to show when loading is false - className: string — Additional CSS classes Skeleton Text props: - noOfLines: number [default: 3] — Number of text lines to render - gap: string | number [default: '8px'] — Gap between lines - variant: 'pulse' | 'shine' | 'none' [default: 'pulse'] — Animation variant - loading: boolean [default: true] — Whether the skeleton is in loading state - children: React.ReactNode — Content to show when loading is false - className: string — Additional CSS classes Example: ```tsx import { Skeleton, SkeletonCircle, SkeletonText } from "@ninna-ui/feedback"; export default function Example() { return (
); } ``` ### Status import { Status } from "@ninna-ui/feedback"; Status props: - value: 'success' | 'danger' | 'warning' | 'info' [default: 'info'] — Status value that determines the indicator color - size: 'sm' | 'md' | 'lg' [default: 'md'] — Size of the status indicator and label - children: React.ReactNode — Optional label text to display next to the indicator - className: string — Additional CSS classes Example: ```tsx import { Status } from "@ninna-ui/feedback"; export default function Example() { return ( Completed ); } ``` ### Toast import { Toast } from "@ninna-ui/feedback"; Toaster props: - position: 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' [default: 'bottom-right'] — Position of toasts on screen - id: string — Unique identifier - only toasts created with a matching toasterId will be shown by this Toaster. Omit for the default global Toaster. - max: number [default: 5] — Maximum number of visible toasts - gap: number [default: 8] — Gap between toasts in pixels - offset: string | number [default: '1rem'] — Offset from screen edges - pauseOnHover: boolean [default: true] — Pause auto-dismiss when hovering over toasts - className: string — Additional CSS classes for the toast container Toast Options props: - title: ReactNode — Toast title - description: ReactNode — Toast description/message - color: 'primary' | 'secondary' | 'accent' | 'neutral' | 'success' | 'danger' | 'warning' | 'info' [default: 'primary'] — Color theme of the toast - isLoading: boolean [default: false] — Show a spinning loader icon. Use with duration: 0 to keep the toast persistent until updated. - variant: 'solid' | 'soft' | 'outline' [default: 'soft'] — Visual variant - duration: number [default: 5000] — Duration in milliseconds (0 = persistent) - closable: boolean [default: true] — Whether the toast can be dismissed - icon: ReactNode — Custom icon - action: { label: string; onClick: () => void; altText?: string } — Action button configuration - toasterId: string — Route this toast to a specific Toaster by its id. Omit to send to the default global Toaster. Toast Methods props: - toast.create(options): string — Create a new toast. Pass color to indicate type (e.g. success, danger). Returns the toast ID. - toast.dismiss(id?): void — Dismiss a specific toast by ID, or dismiss all toasts if no ID is provided - toast.dismissAll(): void — Dismiss all toasts - toast.update(id, options): void — Update an existing toast by ID - toast.promise(promise, options): Promise — Show a loading toast while the promise is pending, then update to success or danger on resolution Example: ```tsx import { Toaster, toast } from "@ninna-ui/feedback"; // Add Toaster to your app root export default function App() { return ( <> ); } // Use toast anywhere in your app function MyComponent() { return ( ); } ``` ====================================================== @ninna-ui/forms ====================================================== ### Checkbox import { Checkbox } from "@ninna-ui/forms"; Checkbox props: - size: 'sm' | 'md' | 'lg' [default: 'md'] — Size of the checkbox - color: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' [default: 'primary'] — Color theme of the checkbox - variant: 'outline' | 'soft' | 'solid' [default: 'outline'] — Visual variant of the checkbox - checked: boolean — Controlled checked state - defaultChecked: boolean — Default checked state for uncontrolled usage - onCheckedChange: (checked: boolean) => void — Callback when checked state changes - label: ReactNode — Label text for the checkbox - description: ReactNode — Description text below the label - labelPosition: 'start' | 'end' [default: 'end'] — Position of the label relative to checkbox - invalid: boolean [default: false] — Whether the checkbox is in an invalid state - icon: ReactNode — Custom icon for checked state - indeterminateIcon: ReactNode — Custom icon for indeterminate state - disabled: boolean [default: false] — Whether the checkbox is disabled - required: boolean [default: false] — Whether the checkbox is required Example: ```tsx import { Checkbox } from "@ninna-ui/forms"; export default function Example() { return ( ); } ``` ### CheckboxGroup import { CheckboxGroup } from "@ninna-ui/forms"; Checkbox Group props: - value: string[] — Controlled selected values - defaultValue: string[] [default: []] — Default selected values (uncontrolled) - onValueChange: (value: string[]) => void — Callback when selection changes - orientation: 'vertical' | 'horizontal' [default: 'vertical'] — Layout orientation - gap: 'sm' | 'md' | 'lg' [default: 'md'] — Gap between items - size: 'sm' | 'md' | 'lg' [default: 'md'] — Size of all checkboxes in the group - color: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' [default: 'primary'] — Color theme for all checkboxes - variant: 'outline' | 'soft' | 'solid' [default: 'outline'] — Visual variant for all checkboxes - disabled: boolean [default: false] — Disable all checkboxes in the group - aria-label: string — Accessible label for the checkbox group Example: ```tsx import { CheckboxGroup, CheckboxGroupItem } from "@ninna-ui/forms"; ``` ### Field import { Field } from "@ninna-ui/forms"; Field props: - label: string — Label text - helperText: string — Helper text displayed below the input - errorText: string — Error text displayed when invalid - required: boolean [default: false] — Whether the field is required - invalid: boolean [default: false] — Whether the field is invalid - disabled: boolean [default: false] — Whether the field is disabled - size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' [default: 'md'] — Size of the field elements - optionalText: string — Text displayed on the right side of the label - children (required): ReactNode — Input component to wrap - id: string — ID for the field (used to link label with input) Example: ```tsx import { Field, Input } from "@ninna-ui/forms"; export default function Example() { return ( ); } ``` ### FileUpload import { FileUpload } from "@ninna-ui/forms"; File Upload props: - size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' [default: 'md'] — Size of the file upload component - accept: string — Accepted file types (e.g., "image/*", ".pdf") - multiple: boolean [default: false] — Allow multiple file selection - maxFileSize: number — Maximum file size in bytes - maxFiles: number [default: 10] — Maximum number of files - disabled: boolean [default: false] — Whether the upload is disabled - required: boolean [default: false] — Whether the field is required - invalid: boolean [default: false] — Whether the upload is in an invalid state - onFilesChange: (files: File[]) => void — Callback when files are selected - label: string — Label for the upload area - helperText: string — Helper text below the upload area - showFileList: boolean [default: true] — Show file list after selection - allowDrag: boolean [default: true] — Allow drag and drop Example: ```tsx import { FileUpload } from "@ninna-ui/forms"; export default function Example() { return ( console.log(files)} /> ); } ``` ### FormControl import { FormControl } from "@ninna-ui/forms"; Form Control props: - id: string — Unique ID for the form field (auto-generated if not provided) - isRequired: boolean [default: false] — Whether the field is required - isInvalid: boolean [default: false] — Whether the field is in an invalid state - isDisabled: boolean [default: false] — Whether the field is disabled - isReadOnly: boolean [default: false] — Whether the field is read-only Form Label props: - children: ReactNode — Label text content - className: string — Additional CSS classes Form Message props: - type: 'error' | 'success' | 'warning' | 'hint' [default: 'error'] — Message type determines styling - children: ReactNode — Message content Example: ```tsx import { FormControl, FormLabel, FormMessage, Input } from "@ninna-ui/forms"; Email We'll never share your email. Password Password must be at least 8 characters. ``` ### FormGroup import { FormGroup } from "@ninna-ui/forms"; Form Group props: - legend: string — Legend/title rendered inside the fieldset legend element - description: string — Optional description text below the legend; linked via aria-describedby - disabled: boolean [default: false] — Disables all form controls inside the fieldset - required: boolean [default: false] — Marks the group as required (shows * indicator in legend) - spacing: 'sm' | 'md' | 'lg' [default: 'md'] — Gap between child fields - direction: 'vertical' | 'horizontal' [default: 'vertical'] — Layout direction of child fields - id: string — ID for the fieldset element (auto-generated if not provided) - className: string — Additional CSS classes - children: ReactNode — Form fields to group together Example: ```tsx import { FormGroup, Field, Input } from "@ninna-ui/forms"; ``` ### Input import { Input } from "@ninna-ui/forms"; Input props: - variant: 'outline' | 'filled' | 'flushed' | 'unstyled' [default: 'outline'] — Visual style variant of the input - color: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' [default: 'primary'] — Color theme of the input focus state - size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' [default: 'md'] — Size of the input - clearable: boolean [default: false] — Show clear button when input has value - onClear: () => void — Callback when clear button is clicked - showCounter: boolean [default: false] — Show character counter (requires maxLength) - maxLength: number — Maximum character length - floatingLabel: string — Floating label text - fullWidth: boolean [default: true] — Whether the input takes full width of its container - invalid: boolean [default: false] — Whether the input is in an invalid state - disabled: boolean [default: false] — Whether the input is disabled - readOnly: boolean [default: false] — Whether the input is read-only - className: string — Additional CSS classes Example: ```tsx import { Input } from "@ninna-ui/forms"; export default function Example() { return ( ); } ``` ### InputGroup import { InputGroup } from "@ninna-ui/forms"; Input Group props: - size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' [default: 'md'] — Size of the input group (affects padding for elements) - startElement: ReactNode — Element to render at the start (inside the input border) - endElement: ReactNode — Element to render at the end (inside the input border) - startElementPointerEvents: 'none' | 'auto' [default: smart] — Override pointer-events on the start slot. By default, decorative content is inert but interactive descendants (button, a, input, [role='button']) receive clicks automatically. - endElementPointerEvents: 'none' | 'auto' [default: smart] — Override pointer-events on the end slot. See startElementPointerEvents. Input Addon props: - size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' [default: 'md'] — Size of the addon - placement: 'start' | 'end' [default: 'start'] — Position of the addon relative to the input Example: ```tsx import { Input, InputGroup, InputAddon } from "@ninna-ui/forms"; import { Search } from "lucide-react"; // With icon inside input }> // With addon outside input
https://
``` ### NumberInput import { NumberInput } from "@ninna-ui/forms"; Number Input props: - size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' [default: 'md'] — Size of the input - value: number — Controlled value - defaultValue: number — Default value (uncontrolled) - onChange: (value: number) => void — Callback when value changes - min: number — Minimum value - max: number — Maximum value - step: number [default: 1] — Step increment - precision: number — Decimal places - showStepper: boolean [default: true] — Show stepper buttons - stepperPosition: 'right' | 'sides' [default: 'right'] — Stepper position - disabled: boolean [default: false] — Disabled state - invalid: boolean [default: false] — Invalid state - readOnly: boolean [default: false] — Read-only state - required: boolean [default: false] — Whether the input is required - allowKeyboardInput: boolean [default: true] — Allow typing values directly - format: (value: number) => string — Custom format function for display value - parse: (value: string) => number — Custom parse function for input value - name: string — Name for form submission - id: string — ID for the input element - incrementLabel: string [default: 'Increase value'] — Accessible label for the increment button - decrementLabel: string [default: 'Decrease value'] — Accessible label for the decrement button Example: ```tsx import { NumberInput } from "@ninna-ui/forms"; export default function Example() { return ( ); } ``` ### PinInput import { PinInput } from "@ninna-ui/forms"; Pin Input props: - length: number [default: 4] — Number of input fields - size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' [default: 'md'] — Size of the inputs - type: 'text' | 'password' | 'number' [default: 'text'] — Input type - mask: boolean [default: false] — Mask input value - otp: boolean [default: false] — One-time password mode (enables autocomplete) - value: string — Controlled value - defaultValue: string — Default value (uncontrolled) - onChange: (value: string) => void — Callback when value changes - onComplete: (value: string) => void — Callback when all fields are filled - disabled: boolean [default: false] — Disabled state - invalid: boolean [default: false] — Invalid state - placeholder: string [default: '○'] — Placeholder for each field - autoFocus: boolean [default: false] — Auto focus the first input on mount - name: string — Name for hidden form submission input - aria-label: string [default: 'PIN input'] — Accessible label for the input group Example: ```tsx import { PinInput } from "@ninna-ui/forms"; export default function Example() { return ( console.log('PIN:', pin)} /> ); } ``` ### RadioGroup import { RadioGroup } from "@ninna-ui/forms"; Radio Group props: - size: 'sm' | 'md' | 'lg' [default: 'md'] — Size of the radio buttons - color: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' [default: 'primary'] — Color theme of the radio buttons - variant: 'outline' | 'soft' | 'solid' [default: 'outline'] — Visual variant of the radio buttons - value: string — Controlled value - defaultValue: string — Default value for uncontrolled usage - onValueChange: (value: string) => void — Callback when value changes - orientation: 'horizontal' | 'vertical' [default: 'vertical'] — Layout orientation - gap: 'sm' | 'md' | 'lg' [default: 'md'] — Gap between radio items - invalid: boolean [default: false] — Whether the radio group is in an invalid state - disabled: boolean [default: false] — Whether the radio group is disabled - required: boolean [default: false] — Whether a selection is required - name: string — Name for form submission - loop: boolean — Whether to loop keyboard navigation - aria-label: string — Accessible label for the radio group - aria-labelledby: string — ID of the element that labels the radio group Radio Card props: - value: string — Value of this radio card (required) - title: ReactNode — Card title - description: ReactNode — Card description text - icon: ReactNode — Icon to display in the card - disabled: boolean [default: false] — Whether this card is disabled - aria-label: string — Accessible label for the radio card - aria-describedby: string — ID of element that describes this radio card Example: ```tsx import { RadioGroup, RadioGroupItem } from "@ninna-ui/forms"; export default function Example() { return ( ); } ``` ### Select import { Select } from "@ninna-ui/forms"; Select props: - size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' [default: 'md'] — Size of the select - color: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' [default: 'primary'] — Color theme of the select - variant: 'outline' | 'filled' | 'flushed' [default: 'outline'] — Visual variant of the select - value: string — Controlled value - defaultValue: string — Default value for uncontrolled usage - onValueChange: (value: string) => void — Callback when value changes - placeholder: string — Placeholder text when no value is selected - invalid: boolean [default: false] — Whether the select is in an invalid state - clearable: boolean [default: false] — Whether the select can be cleared - onClear: () => void — Callback when clear button is clicked - disabled: boolean [default: false] — Whether the select is disabled - required: boolean [default: false] — Whether the select is required - fullWidth: boolean [default: true] — Whether the select takes full width - name: string — Name for form submission - open: boolean — Whether the select dropdown is open (controlled) - defaultOpen: boolean — Default open state (uncontrolled) - onOpenChange: (open: boolean) => void — Callback when open state changes - aria-label: string — Accessible label for the select trigger - aria-labelledby: string — ID of the element that labels the select Example: ```tsx import { Select, SelectItem } from "@ninna-ui/forms"; export default function Example() { return ( ); } ``` ### Slider import { Slider } from "@ninna-ui/forms"; Slider props: - size: 'sm' | 'md' | 'lg' [default: 'md'] — Size of the slider - color: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' [default: 'primary'] — Color theme of the slider - variant: 'solid' | 'soft' [default: 'solid'] — Visual variant of the slider - value: number[] — Controlled value (array for range sliders) - defaultValue: number[] [default: [50]] — Default value for uncontrolled usage - onValueChange: (value: number[]) => void — Callback when value changes - onValueCommit: (value: number[]) => void — Callback when value is committed (on mouse up) - min: number [default: 0] — Minimum value - max: number [default: 100] — Maximum value - step: number [default: 1] — Step increment - label: ReactNode — Label for the slider - helperText: ReactNode — Helper text below slider - showValue: boolean [default: false] — Show current value - showTooltip: boolean [default: false] — Show tooltip on hover/drag - formatValue: (value: number) => string — Format function for value display - marks: SliderMark[] | boolean — Marks to display on the slider track - orientation: 'horizontal' | 'vertical' [default: 'horizontal'] — Orientation of the slider - inverted: boolean [default: false] — Whether the slider is inverted - minStepsBetweenThumbs: number — Minimum steps between thumbs for range sliders - invalid: boolean [default: false] — Whether the slider is in an invalid state - disabled: boolean [default: false] — Whether the slider is disabled - name: string — Name for form submission Example: ```tsx import { Slider } from "@ninna-ui/forms"; export default function Example() { return ( ); } ``` ### Switch import { Switch } from "@ninna-ui/forms"; Switch props: - size: 'sm' | 'md' | 'lg' [default: 'md'] — Size of the switch - color: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' [default: 'primary'] — Color theme of the switch - variant: 'solid' | 'soft' | 'outline' [default: 'solid'] — Visual variant of the switch - checked: boolean — Controlled checked state - defaultChecked: boolean — Default checked state for uncontrolled usage - onCheckedChange: (checked: boolean) => void — Callback when checked state changes - label: ReactNode — Label text for the switch - description: ReactNode — Description text below the label - labelPosition: 'start' | 'end' [default: 'end'] — Position of the label relative to switch - invalid: boolean [default: false] — Whether the switch is in an invalid state - loading: boolean [default: false] — Whether the switch is in a loading state - trackLabels: { on?: string; off?: string } — Track labels for on/off states - thumbIcon: ReactNode — Custom icon for the thumb - disabled: boolean [default: false] — Whether the switch is disabled Example: ```tsx import { Switch } from "@ninna-ui/forms"; export default function Example() { return ( ); } ``` ### Textarea import { Textarea } from "@ninna-ui/forms"; Textarea props: - variant: 'outline' | 'filled' | 'flushed' | 'unstyled' [default: 'outline'] — Visual style variant of the textarea - color: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' [default: 'primary'] — Color theme of the textarea focus state - size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' [default: 'md'] — Size of the textarea - resize: 'none' | 'vertical' | 'horizontal' | 'both' [default: 'vertical'] — Resize behavior of the textarea - rows: number [default: 3] — Number of visible text rows - autoResize: boolean [default: false] — Auto-resize based on content - minRows: number [default: 3] — Minimum rows when autoResize is enabled - maxRows: number — Maximum rows when autoResize is enabled - showCounter: boolean [default: false] — Show character counter (requires maxLength) - maxLength: number — Maximum character length - invalid: boolean [default: false] — Whether the textarea is in an invalid state - disabled: boolean [default: false] — Whether the textarea is disabled Example: ```tsx import { Textarea } from "@ninna-ui/forms"; export default function Example() { return (