-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
333 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
--- | ||
title: Button | ||
description: Displays a button or a component that looks like a button. | ||
--- | ||
|
||
import { Tabs, TabItem } from "@astrojs/starlight/components"; | ||
import { Steps } from "@astrojs/starlight/components"; | ||
|
||
<ComponentPreview name="button-demo" /> | ||
|
||
## Installation | ||
|
||
<Tabs> | ||
<TabItem label="CLI"> | ||
```bash frame="code" | ||
npx shadcn-ng@latest add button | ||
``` | ||
</TabItem> | ||
|
||
<TabItem label="Manual"> | ||
<Steps> | ||
1. Copy and paste the following code into your project. | ||
<ComponentSource name="button" /> | ||
|
||
2. Update the import paths to match your project setup. | ||
</Steps> | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
## Usage | ||
|
||
```ts | ||
import { UbButtonDirective } from "@/components/ui/button.directive"; | ||
``` | ||
|
||
```angular-html | ||
<button ubButton>Button</button> | ||
``` | ||
|
||
## Examples | ||
|
||
### Primary | ||
|
||
<ComponentPreview name="button-demo" /> | ||
|
||
### Secondary | ||
|
||
<ComponentPreview name="button-secondary" /> | ||
|
||
### Destructive | ||
|
||
<ComponentPreview name="button-destructive" /> | ||
|
||
### Outline | ||
|
||
<ComponentPreview name="button-outline" /> | ||
|
||
### Ghost | ||
|
||
<ComponentPreview name="button-ghost" /> | ||
|
||
### Link | ||
|
||
<ComponentPreview name="button-link" /> | ||
|
||
### Icon | ||
|
||
<ComponentPreview name="button-icon" /> | ||
|
||
### With Icon | ||
|
||
<ComponentPreview name="button-with-icon" /> | ||
|
||
### Loading | ||
|
||
<ComponentPreview name="button-loading" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Component } from "@angular/core"; | ||
|
||
import { UbButtonDirective } from "@/registry/default/ui/button.directive"; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [UbButtonDirective], | ||
template: `<button ubButton>Button</button>`, | ||
}) | ||
export class ButtonDemoComponent {} | ||
|
||
export default ButtonDemoComponent; |
12 changes: 12 additions & 0 deletions
12
apps/www/src/registry/default/example/button-destructive.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Component } from "@angular/core"; | ||
|
||
import { UbButtonDirective } from "@/registry/default/ui/button.directive"; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [UbButtonDirective], | ||
template: `<button ubButton variant="destructive">Button</button>`, | ||
}) | ||
export class ButtonDemoComponent {} | ||
|
||
export default ButtonDemoComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Component } from "@angular/core"; | ||
|
||
import { UbButtonDirective } from "@/registry/default/ui/button.directive"; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [UbButtonDirective], | ||
template: `<button ubButton variant="ghost">Button</button>`, | ||
}) | ||
export class ButtonDemoComponent {} | ||
|
||
export default ButtonDemoComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Component } from "@angular/core"; | ||
|
||
import { NgIconComponent, provideIcons } from "@ng-icons/core"; | ||
import { lucideChevronRight } from "@ng-icons/lucide"; | ||
|
||
import { UbButtonDirective } from "@/registry/default/ui/button.directive"; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [UbButtonDirective, NgIconComponent], | ||
viewProviders: [provideIcons({ lucideChevronRight })], | ||
template: `<button ubButton variant="outline" size="icon"> | ||
<ng-icon name="lucideChevronRight" class="h-4 w-4" /> | ||
</button>`, | ||
}) | ||
export class ButtonDemoComponent {} | ||
|
||
export default ButtonDemoComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Component } from "@angular/core"; | ||
|
||
import { UbButtonDirective } from "@/registry/default/ui/button.directive"; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [UbButtonDirective], | ||
template: `<button ubButton variant="link">Button</button>`, | ||
}) | ||
export class ButtonDemoComponent {} | ||
|
||
export default ButtonDemoComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Component } from "@angular/core"; | ||
|
||
import { NgIconComponent, provideIcons } from "@ng-icons/core"; | ||
import { radixReload } from "@ng-icons/radix-icons"; | ||
|
||
import { UbButtonDirective } from "@/registry/default/ui/button.directive"; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [UbButtonDirective, NgIconComponent], | ||
viewProviders: [provideIcons({ radixReload })], | ||
template: `<button ubButton disabled> | ||
<ng-icon name="radixReload" class="mr-2 h-4 w-4 animate-spin" /> | ||
Please wait | ||
</button>`, | ||
}) | ||
export class ButtonDemoComponent {} | ||
|
||
export default ButtonDemoComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Component } from "@angular/core"; | ||
|
||
import { UbButtonDirective } from "@/registry/default/ui/button.directive"; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [UbButtonDirective], | ||
template: `<button ubButton variant="outline">Button</button>`, | ||
}) | ||
export class ButtonDemoComponent {} | ||
|
||
export default ButtonDemoComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Component } from "@angular/core"; | ||
|
||
import { UbButtonDirective } from "@/registry/default/ui/button.directive"; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [UbButtonDirective], | ||
template: `<button ubButton variant="secondary">Button</button>`, | ||
}) | ||
export class ButtonDemoComponent {} | ||
|
||
export default ButtonDemoComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Component } from "@angular/core"; | ||
|
||
import { NgIconComponent, provideIcons } from "@ng-icons/core"; | ||
import { radixEnvelopeOpen } from "@ng-icons/radix-icons"; | ||
|
||
import { UbButtonDirective } from "@/registry/default/ui/button.directive"; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [UbButtonDirective, NgIconComponent], | ||
viewProviders: [provideIcons({ radixEnvelopeOpen })], | ||
template: `<button ubButton> | ||
<ng-icon name="radixEnvelopeOpen" class="mr-2 h-4 w-4" /> | ||
Login with Email | ||
</button>`, | ||
}) | ||
export class ButtonDemoComponent {} | ||
|
||
export default ButtonDemoComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Component } from "@angular/core"; | ||
|
||
import { UbButtonDirective } from "@/registry/new-york/ui/button.directive"; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [UbButtonDirective], | ||
template: `<button ubButton>Button</button>`, | ||
}) | ||
export class ButtonDemoComponent {} | ||
|
||
export default ButtonDemoComponent; |
12 changes: 12 additions & 0 deletions
12
apps/www/src/registry/new-york/example/button-destructive.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Component } from "@angular/core"; | ||
|
||
import { UbButtonDirective } from "@/registry/new-york/ui/button.directive"; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [UbButtonDirective], | ||
template: `<button ubButton variant="destructive">Button</button>`, | ||
}) | ||
export class ButtonDemoComponent {} | ||
|
||
export default ButtonDemoComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Component } from "@angular/core"; | ||
|
||
import { UbButtonDirective } from "@/registry/new-york/ui/button.directive"; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [UbButtonDirective], | ||
template: `<button ubButton variant="ghost">Button</button>`, | ||
}) | ||
export class ButtonDemoComponent {} | ||
|
||
export default ButtonDemoComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Component } from "@angular/core"; | ||
|
||
import { NgIconComponent, provideIcons } from "@ng-icons/core"; | ||
import { lucideChevronRight } from "@ng-icons/lucide"; | ||
|
||
import { UbButtonDirective } from "@/registry/new-york/ui/button.directive"; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [UbButtonDirective, NgIconComponent], | ||
viewProviders: [provideIcons({ lucideChevronRight })], | ||
template: `<button ubButton variant="outline" size="icon"> | ||
<ng-icon name="lucideChevronRight" class="h-4 w-4" /> | ||
</button>`, | ||
}) | ||
export class ButtonDemoComponent {} | ||
|
||
export default ButtonDemoComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Component } from "@angular/core"; | ||
|
||
import { UbButtonDirective } from "@/registry/new-york/ui/button.directive"; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [UbButtonDirective], | ||
template: `<button ubButton variant="link">Button</button>`, | ||
}) | ||
export class ButtonDemoComponent {} | ||
|
||
export default ButtonDemoComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Component } from "@angular/core"; | ||
|
||
import { NgIconComponent, provideIcons } from "@ng-icons/core"; | ||
import { radixReload } from "@ng-icons/radix-icons"; | ||
|
||
import { UbButtonDirective } from "@/registry/new-york/ui/button.directive"; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [UbButtonDirective, NgIconComponent], | ||
viewProviders: [provideIcons({ radixReload })], | ||
template: `<button ubButton disabled> | ||
<ng-icon name="radixReload" class="mr-2 h-4 w-4 animate-spin" /> | ||
Please wait | ||
</button>`, | ||
}) | ||
export class ButtonDemoComponent {} | ||
|
||
export default ButtonDemoComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Component } from "@angular/core"; | ||
|
||
import { UbButtonDirective } from "@/registry/new-york/ui/button.directive"; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [UbButtonDirective], | ||
template: `<button ubButton variant="outline">Button</button>`, | ||
}) | ||
export class ButtonDemoComponent {} | ||
|
||
export default ButtonDemoComponent; |
12 changes: 12 additions & 0 deletions
12
apps/www/src/registry/new-york/example/button-secondary.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Component } from "@angular/core"; | ||
|
||
import { UbButtonDirective } from "@/registry/new-york/ui/button.directive"; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [UbButtonDirective], | ||
template: `<button ubButton variant="secondary">Button</button>`, | ||
}) | ||
export class ButtonDemoComponent {} | ||
|
||
export default ButtonDemoComponent; |
19 changes: 19 additions & 0 deletions
19
apps/www/src/registry/new-york/example/button-with-icon.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Component } from "@angular/core"; | ||
|
||
import { NgIconComponent, provideIcons } from "@ng-icons/core"; | ||
import { radixEnvelopeOpen } from "@ng-icons/radix-icons"; | ||
|
||
import { UbButtonDirective } from "@/registry/new-york/ui/button.directive"; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [UbButtonDirective, NgIconComponent], | ||
viewProviders: [provideIcons({ radixEnvelopeOpen })], | ||
template: `<button ubButton> | ||
<ng-icon name="radixEnvelopeOpen" class="mr-2 h-4 w-4" /> | ||
Login with Email | ||
</button>`, | ||
}) | ||
export class ButtonDemoComponent {} | ||
|
||
export default ButtonDemoComponent; |