Spartans get ready! v1 is coming!
We are very close to our first stable release. Expect more announcements in the coming weeks. v1 was made possible by our partner Zerops.
Getting Started
Stack
Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Autocomplete
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Carousel
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Data Table
- Date Picker
- Dialog
- Dropdown Menu
- Empty
- Form Field
- Hover Card
- Icon
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Label
- Menubar
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner (Toast)
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toggle
- Toggle Group
- Tooltip
Popover
Displays rich content in a portal, triggered by a button.
import { Component } from '@angular/core';
import { BrnPopoverImports } from '@spartan-ng/brain/popover';
import { HlmButtonImports } from '@spartan-ng/helm/button';
import { HlmInputImports } from '@spartan-ng/helm/input';
import { HlmLabelImports } from '@spartan-ng/helm/label';
import { HlmPopoverImports } from '@spartan-ng/helm/popover';
@Component({
selector: 'spartan-popover-preview',
imports: [BrnPopoverImports, HlmPopoverImports, HlmButtonImports, HlmLabelImports, HlmInputImports],
template: `
<brn-popover sideOffset="5">
<button id="edit-profile" variant="outline" brnPopoverTrigger hlmBtn>Open Popover</button>
<div hlmPopoverContent class="grid w-80 gap-4" *brnPopoverContent="let ctx">
<div class="space-y-2">
<h4 class="leading-none font-medium">Dimensions</h4>
<p class="text-muted-foreground text-sm">Set the dimensions for the layer.</p>
</div>
<div class="grid gap-2">
<div class="grid grid-cols-3 items-center gap-4">
<label hlmLabel for="width">Width</label>
<input hlmInput id="width" [defaultValue]="'100%'" class="col-span-2 h-8" />
</div>
<div class="grid grid-cols-3 items-center gap-4">
<label hlmLabel for="maxWidth">Max. width</label>
<input hlmInput id="maxWidth" [defaultValue]="'300px'" class="col-span-2 h-8" />
</div>
<div class="grid grid-cols-3 items-center gap-4">
<label hlmLabel for="height">Height</label>
<input hlmInput id="height" [defaultValue]="'25px'" class="col-span-2 h-8" />
</div>
<div class="grid grid-cols-3 items-center gap-4">
<label hlmLabel for="maxHeight">Max. height</label>
<input hlmInput id="maxHeight" [defaultValue]="'none'" class="col-span-2 h-8" />
</div>
</div>
</div>
</brn-popover>
`,
})
export class PopoverPreview {}Installation
npx nx g @spartan-ng/cli:ui popover
ng g @spartan-ng/cli:ui popover
Usage
import { BrnPopoverImports } from '@spartan-ng/brain/popover';
import { HlmPopoverImports } from '@spartan-ng/helm/popover';<brn-popover>
<button brnPopoverTrigger >Open Popover</button>
<div hlmPopoverContent *brnPopoverContent="let ctx"></div>
</brn-popover>Brain API
BrnPopoverClose
Selector: button[brnPopoverClose]
BrnPopoverContent
Selector: [brnPopoverContent]
BrnPopoverTrigger
Selector: button[brnPopoverTrigger],button[brnPopoverTriggerFor]
Inputs
| Prop | Type | Default | Description |
|---|---|---|---|
| brnPopoverTriggerFor | BrnPopover | undefined | undefined | - |
BrnPopover
Selector: brn-popover
ExportAs: brnPopover
Inputs
| Prop | Type | Default | Description |
|---|---|---|---|
| align | BrnPopoverAlign | center | - |
| sideOffset | unknown | 0 | - |
Helm API
HlmPopoverClose
Selector: [hlmPopoverClose],[brnPopoverClose][hlm]
Inputs
| Prop | Type | Default | Description |
|---|---|---|---|
| class | ClassValue | - | - |
HlmPopoverContent
Selector: [hlmPopoverContent],[brnPopoverContent][hlm]
Inputs
| Prop | Type | Default | Description |
|---|---|---|---|
| class | ClassValue | - | - |