We are currently in alpha version.
Please expect changes. If you find any issues, please report them on our github.
Select
Select components are interactive UI elements that allow users to choose one or more options from a list. They provide a clear, intuitive way to make selections, enhancing form usability and decision-making.
Basic select
Preview
Code
Optional properties
Property | Type | Description |
---|---|---|
|
| Controls select sizing. |
|
| Defines the select shape. |
| string | Specifies a Font Awesome class for the select's icon (e.g., |
|
| Sets the icon's position relative to the select text. Defaults to |
|
| Sets the position of the select options. |
| boolean |
|
| boolean |
|
| boolean | Set this to |
| string | Defines the id of the select. |
| string | Defines the label attached to the select. |
| string | Defines the placeholder of the select. |
| string | Defines the help text of the select. |
| string | Defines the placeholder of the search bar. |
| string | Defines the message to display when no options are found. |
| string | Provides the ability to set custom error messages. |
| string | Allows overriding default styles by passing Tailwind CSS classes. Utilize the |
Optional templates
Property | Type | Description |
---|---|---|
|
| Use this to provide a custom template for the options in the select menu. |
|
| Use this to provide a custom template for the selected option. |
Supported directives
Selector | Directive name | Description |
---|---|---|
| ZapFormFieldIconDirective | Import a directive |
| ZapFormFieldHelpTextDirective | Import a directive |
| ZapLabelDirective | Import a directive |
Example
Preview
Code
How to correctly choose a country?
Close your eyes and smash the keyboard with your face
Use a fake ID
Select the country you actually live in
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 select. Can be |
| Defined the size of the select. Can be |
Colors
You can provide each of these colors for different themes that you use
Property | Description |
---|---|
| Background color of the select. |
| Text color of the select. |
| Border color of the select. |
| Background color of the select when hovered. |
| Ring color of the select when focused. |
| Text color of the header on hover |
| Border color of the select when hovered. |
| Search background color when hovered. |
| Text color of the search input |
| Border color of the search input |
| Background color of the search input when hovered |
| Text color of the search input when hovered |
| Text color of the label |
| Text color of the placeholder of the search input |
| Text color of the placeholder |
| Background color of the checkbox |
| Border color of the checkbox |
| Background color of the checkbox when checked |
| Border color of the checkbox when checked |
| Text color of the checkbox when checked |
| Background color of the chip |
| Text color of the chip |
| Border color of the chip |
| Color of the dismiss icon |
| Color of the dismiss icon when hovered |
| 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 select's corners. |
| Left padding of the select. |
| Right padding of the select. |
| Top padding of the select. |
| Bottom padding of the select. |
| Padding around the select's content. |
| Defines the radius of the checkbox's corners. |
| Left padding of the checkbox in the select. |
| Right padding of the checkbox in the select. |
| Top padding of the checkbox in the select. |
| Bottom padding of the checkbox. |
| Padding around the checkbox in the select. |
| Width of the checkbox. |
| Height of the checkbox. |
| Defines the radius of the search's corners. |
| Left padding of the search in the select. |
| Right padding of the search in the select. |
| Top padding of the search in the select. |
| Bottom padding of the search. |
| Padding around the search in the select. |
| Defines the radius of the chip's corners. |
| Left padding of the chip in the select. |
| Right padding of the chip in the select. |
| Top padding of the chip in the select. |
| Bottom padding of the chip. |
| Padding around the chip in the select. |
| Font size of the select's text. |
| Font weight of the select's text. |
| Line height of the select's text. |
| Letter spacing of the select's text. |
| Font size of the select's label. |
| Font weight of the select's label. |
| Line height of the select's label. |
| Letter spacing of the select's label. |
| Font size of the select's search. |
| Font weight of the select's search. |
| Line height of the select's search. |
| Letter spacing of the select's search. |
| Font size of the select's placeholder. |
| Font weight of the select's placeholder. |
| Line height of the select's placeholder. |
| Letter spacing of the select's placeholder. |
| Font size of the select's option. |
| Font weight of the select's option. |
| Line height of the select's option. |
| Letter spacing of the select's option. |
| Font size of the select's chip. |
| Font weight of the select's chip. |
| Line height of the select's chip. |
| Letter spacing of the select's chip. |
| Font size of the select's dismiss icon. |
| Font weight of the select's dismiss icon. |
| Line height of the select's dismiss icon. |
| Letter spacing of the select's dismiss icon. |
| Font size of the select's help text. |
| Font weight of the select's help text. |
| Line height of the select's help text. |
| Letter spacing of the select's help text. |