Text field with a label, hint, and error message wired up through ARIA.
We never share your email.
We never share your email.
Enter a valid email address
Enter a valid email address
We never share your email.
We never share your email.
As shown on your ID
Enter a valid email address
As shown on your ID
Enter a valid email address
<x-markas.input
label="Email"
type="email"
placeholder="you@example.com"
hint="We never share your email."
/><x-markas.input
label="Email"
type="email"
placeholder="you@example.com"
hint="We never share your email."
disabled
/><x-markas.input
label="Email"
type="email"
placeholder="you@example.com"
hint="We never share your email."
error="Enter a valid email address"
/><x-markas.input
label="Email"
type="email"
placeholder="you@example.com"
hint="We never share your email."
error="Enter a valid email address"
disabled
/>import { Input } from "@/components/markas/Input";
<Input
label="Email"
type="email"
placeholder="you@example.com"
hint="We never share your email."
/>import { Input } from "@/components/markas/Input";
<Input
label="Email"
type="email"
placeholder="you@example.com"
hint="We never share your email."
disabled
/>import { Input } from "@/components/markas/Input";
<Input
label="Email"
type="email"
placeholder="you@example.com"
hint="We never share your email."
error="Enter a valid email address"
/>import { Input } from "@/components/markas/Input";
<Input
label="Email"
type="email"
placeholder="you@example.com"
hint="We never share your email."
error="Enter a valid email address"
disabled
/>import Input from "@/components/markas/Input.vue";
<Input
label="Email"
type="email"
placeholder="you@example.com"
hint="We never share your email."
/>import Input from "@/components/markas/Input.vue";
<Input
label="Email"
type="email"
placeholder="you@example.com"
hint="We never share your email."
disabled
/>import Input from "@/components/markas/Input.vue";
<Input
label="Email"
type="email"
placeholder="you@example.com"
hint="We never share your email."
error="Enter a valid email address"
/>import Input from "@/components/markas/Input.vue";
<Input
label="Email"
type="email"
placeholder="you@example.com"
hint="We never share your email."
error="Enter a valid email address"
disabled
/>Examples
With icons
Prefix and suffix
Sizes
<div class="grid gap-4">
<x-markas.input name="small" label="Small" placeholder="Search docs" class="h-8! text-xs!" />
<x-markas.input name="medium" label="Medium" placeholder="Search docs" />
<x-markas.input name="large" label="Large" placeholder="Search docs" class="h-12! px-4! text-base!" />
</div>States
Letters, numbers, and dots only.
Enter a valid email address.
Letters, numbers, and dots only.
Enter a valid email address.
Letters, numbers, and dots only.
Enter a valid email address.
Letters, numbers, and dots only.
Enter a valid email address.
Letters, numbers, and dots only.
Enter a valid email address.
<div class="grid gap-4">
<x-markas.input name="username" label="Username" value="budi.santoso" hint="Letters, numbers, and dots only." />
<x-markas.input name="email" type="email" label="Email" value="budi@markas" error="Enter a valid email address." />
<x-markas.input name="api_key" label="API key" value="mk_live_4f8a2c91" readonly />
<x-markas.input name="workspace" label="Workspace" value="MarkasUI" disabled />
</div>Sign-up form
Installation
npx markasui@latest add inputpnpm dlx markasui@latest add inputyarn dlx markasui@latest add inputbunx --bun markasui@latest add input- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
resources/views/components/markas/input.blade.php.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/Input.tsx.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/Input.vue.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/lib/components/markas/Input.svelte.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/Input.astro.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/app/markas/input.component.ts.
Usage
<x-markas.input name="email" type="email" label="Email" hint="We never share your email." />
<x-markas.input name="password" type="password" label="Password" :error="$errors->first('password')" />import { Input } from "@/components/markas/Input";
<Input name="email" type="email" label="Email" hint="We never share your email." />
<Input name="password" type="password" label="Password" error={errors.password} /><script setup lang="ts">
import { ref } from "vue";
import Input from "@/components/markas/Input.vue";
const email = ref("");
</script>
<template>
<Input
v-model="email"
name="email"
type="email"
label="Email"
hint="We never share your email."
/>
</template><script lang="ts">
import Input from "$lib/components/markas/Input.svelte";
let email = $state("");
</script>
<Input
bind:value={email}
name="email"
type="email"
label="Email"
hint="We never share your email."
/>---
import Input from "@/components/markas/Input.astro";
---
<Input name="email" type="email" label="Email" hint="We never share your email." />
<Input name="password" type="password" label="Password" error="Password is too short." />No client script: the field is a native input.
import { Component, signal } from "@angular/core";
import { Input } from "./markas/input.component";
@Component({
selector: "app-sign-in",
imports: [Input],
template: `
<markas-input
[(value)]="email"
name="email"
type="email"
label="Email"
hint="We never share your email."
/>
`,
})
export class SignIn {
readonly email = signal("");
}- Extra attributes (
name,placeholder,required,class) go to the<input>element, not its wrapper. - Input has no built-in text. All visible text comes from
label,hint, anderror, so pass them in your site’s language.
Props
| Name | Type | Default | Description |
|---|---|---|---|
label | string | - | Label text, linked to the input through for and id. |
hint | string | - | Hint text below the input. Hidden while an error is shown. |
error | string | - | Error message. Turns on aria-invalid and the danger border. |
id | string | auto | Input id. Generated automatically when empty. |
type | string | text | Native type attribute (email, password, and so on). |
value / v-model / bind:value / [(value)] | string | - | Current text. Blade and Astro use the value attribute, React value or defaultValue, Vue v-model, Svelte bind:value, Angular value or [(value)]. |
Accessibility
- The label is linked to the input through the for and id attributes.
- Screen readers announce the error and hint through aria-describedby.
- aria-invalid is set when the error prop is filled.
Related components
More form components with the same classes in every framework.
- ButtonButton with primary, secondary, ghost, and danger variants.
- CheckboxNative checkbox with an optional label and description, custom styled without JavaScript.
- ComboboxText input with a filtered suggestion list in a popover, following the WAI-ARIA Combobox pattern with list autocomplete.
- Input OTPOne-time code input split into single-digit boxes, with auto advance, paste support, and one hidden field for form submit.
- LabelForm label with consistent styling and optional required or optional markers that screen readers announce correctly.
- Radio GroupGroup of native radios inside a fieldset and legend for picking one of several options.