We are currently in alpha version.
Please expect changes. If you find any issues, please report them on our github.
Radio
Radio buttons are interactive UI elements that allow users to select one option from a predefined set. They provide a clear, intuitive way to make mutually exclusive choices, enhancing decision-making and form interactions.
Basic radio
Optional properties
Property | Type | Description |
---|---|---|
|
| An array of options for the radio. Each option should have a name and value. |
|
| Controls radio's variant. |
| string | Defines the label attached to the radio. |
| string | Provides the ability to set custom error messages. |
| string | Allows overriding default styles by passing Tailwind CSS classes. Utilize the |
Supported directives
These are optional directives for radio content header only
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 radio. |
| Text color of the radio. |
| Border color of the radio. |
| Background color of the radio when hovered. |
| Text color of the radio when hovered. |
| Border color of the radio when hovered. |
| Background color of the radio when focused. |
| Border color of the radio when focused. |
| Text color of the label |
| Text color of the label when hovered |
| Background color of the radio when checked. |
| Background color when checked/p> |
| Border color of the radio when checked. |
| The color of the radio when checked. |
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 radio's corners. |
| Left padding of the radio. |
| Right padding of the radio. |
| Top padding of the radio. |
| Bottom padding of the radio. |
| Padding around the radio's content. |
| Width of the radio. |
| Height of the radio. |
| Font size of the radio's text. |
| Font weight of the radio's text. |
| Line height of the radio's text. |
| Letter spacing of the radio's text. |
| Font size of the label |
| Font weight of the label |
| Line height of the label |
| Letter spacing of the label |