You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Buttons are interactive elements that trigger actions when clicked. They are used for form submissions, dialogs, and other user interactions where the user performs an action.
14
+
15
+
## Usage
16
+
17
+
Importthecomponent:
18
+
19
+
```ts
20
+
import { Button } from"@eqtylab/equality";
21
+
```
22
+
23
+
Basic usage with required properties:
24
+
25
+
```tsx
26
+
<Button>Click me</Button>
27
+
```
28
+
29
+
## Variants
30
+
31
+
The Button component supports multiple visual variants to communicate different levels of emphasis and intent.
32
+
33
+
### Primary
34
+
35
+
As the default variant, the `primary` variant is used for main call-to-action buttons and intended next steps.
Use the `navigation` variant for navigation elements that require button styling. These should only be used for navigation and never for form actions like "next" or "previous".
When an `href` prop is provided, buttons render as an anchor elements while maintaining their styling. This should be used in favor of `onClick` events when using buttons for navigation.
154
203
155
-
<divclassName="flex gap-2">
156
-
<Button
157
-
variant="secondary"
158
-
size="md"
159
-
href="https://example.com"
160
-
target="_blank"
161
-
rel="noopener noreferrer"
162
-
>
163
-
Open in New Tab
164
-
</Button>
165
-
<Button
166
-
variant="tertiary"
167
-
size="md"
168
-
href="https://example.com/file.pdf"
169
-
download
170
-
>
171
-
Download File
172
-
</Button>
173
-
</div>
174
-
}
204
+
Button also accepts common HTML link-related properties such as `target`, and `download`.
205
+
206
+
```tsx
207
+
<Buttonhref="https://example.com"target="_blank">New Tab Link Button</Button>
0 commit comments