Velvet Thunder

Input

Sizes

<DemoSpaceX>
  <VelvetInput @size="sm" />
  <VelvetInput @size="md" />
  <VelvetInput @size="lg" />
</DemoSpaceX>

Pill

<VelvetInput @isPill={{true}} />

Disabled

<VelvetInput @isDisabled={{true}} />

Invalid

<VelvetInput @isInvalid={{true}} />

Placeholder

<VelvetInput @placeholder="Type something here..." />

Types

<DemoSpaceX>
  <VelvetInput @type="number" />
  <VelvetInput @type="time" />
  <VelvetInput @type="date" />
  <VelvetInput @type="range" />
</DemoSpaceX>

Examples

Handle Input Events

Edit this demo

Use the @onInput argument to handle input events.

Value: Value
<DemoSpaceY>
  <div>Value: {{this.value}}</div>
  <VelvetInput @onInput={{this.onInput}} @value={{this.value}} />
</DemoSpaceY>

Handle Change Events

Edit this demo

Use the @onChange argument to handle change events.

Value: Value
<DemoSpaceY>
  <div>Value: {{this.value}}</div>
  <VelvetInput @onChange={{this.onChange}} @value={{this.value}} />
</DemoSpaceY>

Signature

Element

HTMLInputElement

Blocks

This component does not accept any blocks.

Arguments

NameDescriptionTypeDefault Value
@isDisabledIndicate if the input is disabled.booleanfalse
@isInvalidIndicate if the input is invalid.booleanfalse
@isPillIndicate if the input is pill shaped.booleanfalse
@onChangeHandle the input's `change` event.(value: string, event: Event) => voidundefined
@onInputHandle the input's `input` event.(value: string, event: Event) => voidundefined
@placeholderThe placeholder of the input.string""
@sizeThe size of the input.'sm' | 'md' | 'lg'"md"
@typeThe type of the input.string""
@valueThe value of the input.string""
@variantThe appearance of the input.string | 'primary'"primary"
Arguments marked with * are required.
Icon Link
Link