Controls
Glass Input
A text field set into the glass, with an optional label and hint.
Preview
Installation
Install the package once, then import the parts you use into a standalone component.
Install
npm install ngx-vitreo @angular/cdk @floating-ui/domImport
import { GlassInput } from 'ngx-vitreo';
@Component({
imports: [GlassInput],
// ...
})Usage
Usage
<form class="cpreview-form" (ngSubmit)="save()">
<input
glassInput
label="Name"
placeholder="Ada Lovelace"
name="name"
[attr.aria-invalid]="invalid() || null"
[(ngModel)]="name"
(ngModelChange)="invalid.set(false)"
/>
<button glassButton type="submit" variant="prominent">Save</button>
</form>API reference
GlassInput
input[glassInput]
| Input | Type | Default | Description |
|---|---|---|---|
label | string | None | Visible label above the field, linked with for. |
hint | string | None | Helper text below the field, linked with aria-describedby. |
type | string | 'text' | Native input type. |
ngModel / formControl | native input | None | The directive sits on the input, so Angular forms bind it as usual. |