We are currently in alpha version.
Please expect changes. If you find any issues, please report them on our github.
Input
Inputs are essential UI elements that allow users to enter and edit single-line text. They provide a clear, intuitive way to capture user data, enhancing form interactions and data collection.
Basic input
Preview
Code
Optional properties
Property | Type | Description |
---|---|---|
|
| Defines the input type. |
|
| Controls input sizing. |
|
| Defines the input shape. |
| string | Specifies a Font Awesome class for the input's icon (e.g., |
|
| Sets the icon's position relative to the input text. Defaults to |
| string | Defines the id of the input. |
| string | Defines the label attached to the input. |
| string | Defines the placeholder of the input. |
| string | Defines the help text of the input. |
| string | Controls browser suggestions for input values. |
| string | Provides the ability to set custom error messages. |
| string | Allows overriding default styles by passing Tailwind CSS classes. Utilize the |
Supported directives
Selector | Directive name | Description |
---|---|---|
| ZapFormFieldIconDirective | Import a directive |
| ZapFormFieldHelpTextDirective | Import a directive |
| ZapLabelDirective | Import a directive |
Example
Preview
Code
Username
Your username must be:
- Unique
- Be at least 6 characters long
- Not contain any special characters
Global configurations
A list of global styles, including shape, size, color, font sizes, font weights, and letter spacing can be provided via themeLibrary
in the provideZapOption
provider.. If you have multi theme setup, you can also provide theme specific colors. These apply to all default variants through out the app unless component level styles are provided.
Example
app.config.ts
Shape and Size
Property | Description |
---|---|
| Defines the shape of the input. Can be |
| Defined the size of the input. Can be |
Colors
You can provide each of these colors for different themes that you use
Property | Description |
---|---|
| Background color of the input. |
| Text color of the input. |
| Border color of the input. |
| Text color of the label |
| Text color of the placeholder |
| Border color of the input when focused. |
| Background color of the input when focused. |
| Text color of the input when focused. |
| Color of the icon |
| Text color of the help text |
Other styles
You can provide a bunch of other styles, that are not theme based but rather generic
Property | Description |
---|---|
| Defines the radius of the input's corners. |
| Left padding of the input. |
| Right padding of the input. |
| Top padding of the input. |
| Bottom padding of the input. |
| Padding around the input's content. |
| Width of the input. |
| Height of the input. |
| Font size of the input's text. |
| Font weight of the input's text. |
| Line height of the input's text. |
| Letter spacing of the input's text. |
| Font size of the label |
| Font weight of the label |
| Line height of the label |
| Letter spacing of the label |
| Font size of the placeholder |
| Font weight of the placeholder |
| Line height of the placeholder |
| Letter spacing of the placeholder |
| Font size of the icon |
| Font weight of the icon |
| Line height of the icon |
| Letter spacing of the icon |
| Font size of the help text |
| Font weight of the help text |
| Line height of the help text |
| Letter spacing of the help text |