Skip to content

Input ​

A customizable text input component with multiple types, variants, and validation states. Built with accessibility in mind and fully customizable through CSS custom properties.

Variants ​

Six visual variants for different UI contexts and levels of emphasis.

PreviewCode
RTL
html
<ore-input variant="solid" placeholder="Solid"></ore-input>
<ore-input variant="flat" placeholder="Flat"></ore-input>
<ore-input variant="bordered" placeholder="Bordered"></ore-input>
<ore-input variant="outline" placeholder="Outline"></ore-input>
<ore-input variant="ghost" placeholder="Ghost"></ore-input>
<ore-input variant="text" placeholder="Text"></ore-input>

Colors ​

Six semantic colors for different contexts and validation states. Defaults to neutral when no color is specified.

PreviewCode
RTL
html
<ore-grid cols="1" cols-sm="3" cols-md="4" cols-lg="5" gap="md" style="width: 100%;">
  <ore-input variant="flat" placeholder="Default"></ore-input>
  <ore-input variant="flat" color="primary" placeholder="Primary"></ore-input>
  <ore-input variant="flat" color="secondary" placeholder="Secondary"></ore-input>
  <ore-input variant="flat" color="info" placeholder="Info"></ore-input>
  <ore-input variant="flat" color="success" placeholder="Success"></ore-input>
  <ore-input variant="flat" color="warning" placeholder="Warning"></ore-input>
  <ore-input variant="flat" color="error" placeholder="Error"></ore-input>
</ore-grid>

Input Types ​

Different input types for various use cases.

PreviewCode
RTL
html
<ore-grid cols="1" cols-sm="3" cols-md="4" cols-lg="5" gap="md" style="width: 100%;">
  <ore-input variant="bordered" color="secondary" type="text" placeholder="Text input"></ore-input>
  <ore-input variant="bordered" color="success" type="email" placeholder="email@example.com"></ore-input>
  <ore-input variant="bordered" color="warning" type="password" placeholder="Password"></ore-input>
  <ore-input variant="bordered" color="error" type="number" placeholder="123"></ore-input>
</ore-grid>

Sizes ​

Three sizes for different contexts.

PreviewCode
RTL
html
<ore-grid cols="3">
  <ore-input variant="flat" size="sm" placeholder="Small"></ore-input>
  <ore-input variant="flat" size="md" placeholder="Medium"></ore-input>
  <ore-input variant="flat" size="lg" placeholder="Large"></ore-input>
  <ore-input variant="flat" size="sm" label="Small" placeholder="Small"></ore-input>
  <ore-input variant="flat" size="md" label="Medium" placeholder="Medium"></ore-input>
  <ore-input variant="flat" size="lg" label="Large" placeholder="Large"></ore-input>
</ore-grid>

Rounded (Custom Border Radius) ​

Use the rounded attribute to apply border radius from the theme. Use it without a value (or rounded="full") for pill shape, or specify a theme value like "lg", "xl", etc.

PreviewCode
RTL
html
<!-- Default/Full: Pill shape (9999px) -->
<ore-input rounded placeholder="Search..." variant="flat">
  <ore-icon slot="prefix" name="search" size="18"></ore-icon>
</ore-input>

<!-- Large: 0.5rem / 8px -->
<ore-input rounded="lg" placeholder="Enter email" variant="bordered" label="Email"></ore-input>

<!-- Extra Large: 0.75rem / 12px -->
<ore-input rounded="xl" placeholder="Amount" variant="outline" size="lg">
  <span slot="prefix">$</span>
  <span slot="suffix">USD</span>
</ore-input>

<!-- 2XL: 1rem / 16px -->
<ore-input rounded="2xl" placeholder="Full Name" variant="flat" color="error"></ore-input>

<!-- 3XL: 1.5rem / 24px -->
<ore-input rounded="3xl" placeholder="Website" variant="ghost"></ore-input>

Customization ​

Prefix & Suffix ​

Add prefix or suffix content like icons or clear buttons using slots.

PreviewCode
RTL
html
<ore-input placeholder="Search...">
  <ore-icon slot="prefix" name="search" size="18"></ore-icon>
</ore-input>
<ore-input placeholder="Enter amount">
  <span slot="prefix">$</span>
  <span slot="suffix">USD</span>
</ore-input>

Integrated Label ​

Use the label attribute to render an inset label inside the input field, creating a modern Material Design-style floating label effect. Always provide a label via the label attribute, aria-label, or an associated <label> element: do not rely on placeholder text as a label replacement, as placeholders disappear on input.

PreviewCode
RTL
html
<ore-grid cols="1" cols-sm="3" cols-md="4" cols-lg="5" gap="md" style="width: 100%;">
  <ore-input label="Full Name" placeholder="Jane Doe" value="Jane Doe"></ore-input>
  <ore-input label="Email Address" type="email" placeholder="you@example.com"></ore-input>
  <ore-input label="Phone Number" type="tel" value="+1 (555) 123-4567"></ore-input>
</ore-grid>

Label with Variants ​

Labels work seamlessly with all variants and colors.

PreviewCode
RTL
html
<ore-grid cols="1" cols-sm="3" cols-md="4" cols-lg="5" gap="md" style="width: 100%;">
  <ore-input variant="solid" label="Username" value="johndoe"></ore-input>
  <ore-input variant="flat" color="secondary" label="Company" placeholder="Enter company name"></ore-input>
  <ore-input variant="bordered" color="success" label="Verified Email" value="user@company.com"></ore-input>
  <ore-input variant="outline" color="warning" label="Pending Review" value="Awaiting approval"></ore-input>
  <ore-input variant="ghost" label="Country" color="error" value="Germany"></ore-input>
  <ore-input variant="text" label="Notes" placeholder="Add your notes here"></ore-input>
</ore-grid>

Label with Prefix/Suffix ​

Combine labels with prefix and suffix slots for rich input fields.

PreviewCode
RTL
html
<ore-input label="Search" placeholder="Type to search...">
  <ore-icon slot="prefix" name="search" size="18"></ore-icon>
</ore-input>
<ore-input label="Amount" value="1250">
  <span slot="prefix">$</span>
  <span slot="suffix">USD</span>
</ore-input>
<ore-input label="Website" type="url" value="example.com">
  <ore-icon slot="prefix" name="globe" size="18"></ore-icon>
</ore-input>

Label Placement ​

Labels can be placed inside the input field (default) or above it.

PreviewCode
RTL
html
<ore-input label="Inset Label" value="default behavior"></ore-input>
<ore-input label="Outside Label" label-placement="outside" value="placed above"></ore-input>

Helper Text ​

Provide additional context or validation messages below the input using the helper attribute or slot.

PreviewCode
RTL
html
<ore-input label="Password" type="password" helper="Must be at least 8 characters long"></ore-input>

States ​

Disabled & Readonly ​

Prevent interaction or modification of the input.

PreviewCode
RTL
html
<ore-input disabled placeholder="Disabled input"></ore-input> <ore-input readonly value="Read-only value"></ore-input>

For first-run forms, combine a visible label, helper text, and progressive validation feedback.

PreviewCode
RTL
html
<div style="display: grid; gap: 0.75rem; max-width: 26rem; width: 100%;">
  <ore-input
    label="Workspace name"
    placeholder="Acme Marketing"
    helper="This appears in invites and email notifications."
    clearable></ore-input>

  <ore-input
    type="email"
    label="Owner email"
    placeholder="you@company.com"
    helper="We will send setup instructions to this address."></ore-input>

  <ore-input
    type="text"
    label="Project key"
    value="acme space"
    error="Use lowercase letters, numbers, and dashes only."></ore-input>
</div>

API Reference ​

Attributes ​

AttributeTypeDefaultDescription
type'text' | 'email' | 'password' | 'search' | 'url' | 'tel' | 'number''text'Input type
valuestring''Current input value
namestring''Form field name
placeholderstring''Placeholder text
labelstring''Label text
label-placement'inset' | 'outside''inset'Label placement
helperstring''Helper text below input
disabledbooleanfalseDisable the input
readonlybooleanfalseMake the input read-only
requiredbooleanfalseMark field as required
fullwidthbooleanfalseExpand to full width
size'sm' | 'md' | 'lg''md'Input size
variant'solid' | 'flat' | 'bordered' | 'outline' | 'ghost' | 'text''solid'Visual variant
color'primary' | 'secondary' | 'success' | 'warning' | 'error''primary'Color theme

Slots ​

SlotDescription
prefixContent before the input (e.g., icon)
suffixContent after the input (e.g., clear button, unit)
helperComplex helper content below the input

Events ​

EventDetailDescription
input{ value: string, originalEvent: Event }Emitted when the value changes (user input)
change{ value: string, originalEvent: Event }Emitted when value is committed (blur or Enter)

CSS Custom Properties ​

PropertyDescriptionDefault
--input-bgBackground colorVariant-dependent
--input-colorText colorVariant-dependent
--input-border-colorBorder colorVariant-dependent
--input-placeholder-colorPlaceholder text colorTheme-dependent
--input-radiusBorder radiusvar(--rounded-lg)
--input-paddingInner padding (block inline)Size-dependent
--input-gapGap between prefix/suffix icons and input textSize-dependent
--input-font-sizeFont sizeSize-dependent
--input-heightField heightSize-dependent
--input-hover-bgField background on hover (flat/ghost variants)Variant-dependent
--input-hover-border-colorField border on hover (flat/bordered variants)Variant-dependent
--input-focus-bgField background when focused (flat variant)Variant-dependent
--input-focus-border-colorField border when focused (flat/text variants)Variant-dependent

Accessibility ​

The input component follows WCAG 2.1 Level AA standards. Pressing Tab moves focus to the input, and native input behavior applies (e.g., Enter to commit). Proper ARIA states are reflected for disabled, required, and readonly conditions. Labels are associated via aria-label or <label> elements: always provide one through the label attribute, an explicit aria-label, or an associated <label> element. Use semantic colors (success, error, warning) to convey validation states alongside text, not color alone.