We are currently in alpha version.
Please expect changes. If you find any issues, please report them on our github.
Button
Buttons are essential elements in user interfaces, serving as interactive components that trigger actions or events. They provide users with a visual cue for interaction and play a vital role in guiding navigation and facilitating user engagement.
Basic button
html
Optional properties
Property | Type | Description |
---|---|---|
|
| Controls button sizing. |
|
| Defines the button shape. |
|
| Defines the button style. |
| string | Sets the button's text. |
| string | Specifies a Font Awesome class for the button's icon (e.g., |
|
| Sets the icon's position relative to the button text. Defaults to |
| boolean | Creates a button with only an icon (no text). Default is |
| boolean | Disables the button. Default is |
|
| Defines the button type. |
| string | Specifies an image URL for the button's icon (e.g., |
|
| Sets the image's position relative to the button text. Defaults to |
| string | Allows overriding default styles by passing Tailwind CSS classes. Utilize the |
Supported directives
Selector | Directive name | Description |
---|---|---|
| ZapIconDirective | A directive that enables adding any type of icon to a button, including SVGs, font-based icons, and more. |
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
Shape and Size
Property | Description |
---|---|
| Defines the shape of the button. Can be |
| Defined the size of the button. Can be |
Colors
You can provide each of these colors for different themes that you use
Property | Description |
---|---|
| Background color of the button. |
| Text color of the button. |
| Border color of the button. |
| Background color of the button when hovered. |
| Text color of the button when hovered. |
| Border color of the button when hovered. |
| Background color of the button when active (e.g., clicked). |
| Text color of the button when active (e.g., clicked). |
| Border color of the button when active (e.g., clicked). |
| Background color of the button when disabled. |
| Text color of the button when disabled. |
| Border color of the button when disabled. |
| Color for the icon |
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 button's corners. |
| Left padding of the button. |
| Right padding of the button. |
| Top padding of the button. |
| Bottom padding of the button. |
| Padding around the button's content. |
| Width of the button. |
| Height of the button. |
| Font size of the button's text. |
| Font weight of the button's text. |
| Line height of the button's text. |
| Letter spacing of the button's text. |
| Transforms the button's text (e.g., uppercase, lowercase). |