We are currently in alpha version.
Please expect changes. If you find any issues, please report them on our github.
Checkbox
Checkboxes are interactive UI elements that allow users to select one or multiple options. They provide a clear, accessible way to toggle settings, make selections, or confirm choices.
Basic checkbox
html
Optional properties
Property | Type | Description |
---|---|---|
| string | Defines the id of the checkbox. |
| string | Defines the label attached to the checkbox. |
|
| Defines the position of the label against the checkbox. By default it's |
| boolean | Provides the ability to check/uncheck the checkbox. Default is |
|
| Defines the checkbox shape. |
|
| Controls checkbox sizing. |
| 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 |
---|---|---|
| ZapLabelDirective | Import a directive |
Example
Preview
Code
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
Colors
You can provide each of these colors for different themes that you use
Property | Description |
---|---|
| Background color of the checkbox. |
| Text color of the checkbox. |
| Border color of the checkbox. |
| Background color of the checkbox when hovered. |
| Text color of the checkbox when hovered. |
| Border color of the checkbox when hovered. |
| Background color of the checkbox when focused. |
| Border color of the checkbox when focused. |
| Text color of the checkbox when checked. |
| Background color of the checkbox when checked. |
| Border color of the checkbox when checked. |
| Text color of the label |
| Text color of the label 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 checkbox's corners. |
| Left padding of the checkbox. |
| Right padding of the checkbox. |
| Top padding of the checkbox. |
| Bottom padding of the checkbox. |
| Padding around the checkbox's content. |
| Width of the checkbox. |
| Height of the checkbox. |
| Font size of the checkbox's text. |
| Font weight of the checkbox's text. |
| Line height of the checkbox's text. |
| Letter spacing of the checkbox'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 help text |
| Font weight of the help text |
| Line height of the help text |
| Letter spacing of the help text |