Skip to content
MarkasUI
Type to search

    Guide

    MarkasUI

    Form

    Feedback

    Overlay

    Navigation

    Data

    Sections

    Animations

    Backgrounds

    Buttons

    Templates

    Pages

    Input

    Text field with a label, hint, and error message wired up through ARIA.

    We never share your email.

    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

    Input

    <x-markas.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."
    />
    import Input from "@/components/markas/Input.vue";
    
    <Input
      label="Email"
      type="email"
      placeholder="you@example.com"
      hint="We never share your email."
    />
    <script lang="ts">
      import Input from "$lib/components/markas/Input.svelte";
    </script>
    
    <div class="grid gap-4">
      <Input
        name="name"
        label="Full name"
        placeholder="Budi Santoso"
        hint="As shown on your ID"
      />
      <Input
        name="email"
        type="email"
        label="Email"
        value="budi@"
        error="Enter a valid email address"
      />
      <Input name="code" label="Invite code" value="MARKAS-2026" disabled />
    </div>
    ---
    import Input from "@/components/markas/Input.astro";
    ---
    
    <div class="grid gap-4">
      <Input
        name="name"
        label="Full name"
        placeholder="Budi Santoso"
        hint="As shown on your ID"
      />
      <Input
        name="email"
        type="email"
        label="Email"
        value="budi@"
        error="Enter a valid email address"
      />
      <Input name="code" label="Invite code" value="MARKAS-2026" disabled />
    </div>
    import { Component } from "@angular/core";
    import { Input } from "./markas/input.component";
    
    @Component({
      selector: "markas-example",
      imports: [Input],
      template: `
        <div class="grid gap-4">
          <markas-input
            name="name"
            label="Full name"
            placeholder="Budi Santoso"
            hint="As shown on your ID"
          />
          <markas-input
            name="email"
            type="email"
            label="Email"
            value="budi&#64;"
            error="Enter a valid email address"
          />
          <markas-input
            name="code"
            label="Invite code"
            value="MARKAS-2026"
            disabled
          />
        </div>
      `,
    })
    export default class InputExample {}

    Examples

    With icons

    Prefix and suffix

    USD
    https://
    USD
    https://
    USD
    https://
    USD
    https://
    USD
    https://

    Sizes

    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.

    Sign-up form

    Create an account

    Start your free 14-day trial. No card required.

    At least 8 characters.

    Create an account

    Start your free 14-day trial. No card required.

    At least 8 characters.

    Create an account

    Start your free 14-day trial. No card required.

    At least 8 characters.

    Create an account

    Start your free 14-day trial. No card required.

    At least 8 characters.

    Create an account

    Start your free 14-day trial. No card required.

    At least 8 characters.

    Installation

    npx markasui@latest add input

    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, and error, so pass them in your site’s language.

    Props

    NameTypeDefaultDescription
    labelstring-Label text, linked to the input through for and id.
    hintstring-Hint text below the input. Hidden while an error is shown.
    errorstring-Error message. Turns on aria-invalid and the danger border.
    idstringautoInput id. Generated automatically when empty.
    typestringtextNative 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.