Component
Input
A dense input primitive with Axie focus, disabled, placeholder, and invalid states.
Preview
Installation
Install the package, then import the component and shared stylesheet in your app.
Package install
Install the package when you want components imported from axie-ui.
install
pnpm add axie-uiImport
code
import "axie-ui/styles.css";import { Input } from "axie-ui";Registry install
Use the direct URL when you want shadcn to copy editable source into your app. This works without the official registry and does not install axie-ui.
registry
pnpm dlx shadcn@latest add https://axie.alexi.life/r/input.jsonCopied source import
code
import "@/styles/axie.css";import { Input } from "@/components/axie/input";Prefer @axie/input? Add the Axie namespace once from the Installation page, then use that shorthand.
Usage
code
import { Input } from "axie-ui";export function Example() { return <Input placeholder="alexi@example.com" />;}Accessibility
- Use labels outside the input; placeholders are not labels.
- Expose invalid state with `aria-invalid` and connect error text with `aria-describedby`.
- Choose the correct input type for email, URL, number, search, and password fields.
Invalid
Use aria-invalid to trigger the error treatment.
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | InputHTMLAttributes<HTMLInputElement> | - | Accepts every native input prop. |
| className | string | - | Additional classes for layout-specific sizing. |